diff options
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/BsuFantomSection/LoginForm.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/containers/BsuFantomSection/LoginForm.tsx b/src/containers/BsuFantomSection/LoginForm.tsx index 3204a64..69cba90 100644 --- a/src/containers/BsuFantomSection/LoginForm.tsx +++ b/src/containers/BsuFantomSection/LoginForm.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import { TextField, Button, Grid } from '@material-ui/core'; import { useAuth } from '../../hooks/useAuth'; +import { post } from '../../requests'; const LoginForm: React.FC = () => { @@ -16,7 +17,10 @@ const LoginForm: React.FC = () => { setPassword(event.target.value); }; - const handleSubmit = () => login(username, password); + const handleSubmit = () => login(username, password) + .then(success => success || post('/users', { username, password }) + .then(() => login(username, password)) + ); return ( <Grid container direction="column" spacing={2}> |