From a5ae2653d8ccdaf00270c0c8c8a30b88d7955114 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 1 Feb 2020 16:33:56 +0200 Subject: Do stuff --- frontend/src/Login.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'frontend/src/Login.js') diff --git a/frontend/src/Login.js b/frontend/src/Login.js index e30b496..1a1cb2b 100644 --- a/frontend/src/Login.js +++ b/frontend/src/Login.js @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { useForm } from 'react-hook-form'; -import { navigate } from '@reach/router'; +import { navigate, Link } from '@reach/router'; import axios from './axios'; import userState from './UserState'; @@ -13,6 +13,7 @@ const Login = () => { try { const resp = await axios.post('/login', data); const { username } = resp.data; + userState.authError = null; userState.username = username; navigate('/'); } catch (err) { @@ -34,8 +35,14 @@ const Login = () => { +
{loginError}
+
+ No account? Register here. +
{/*
{errors}
*/} ); -- cgit v1.3