Hide google login button and update login logic

This commit is contained in:
Hazem Krimi
2021-04-29 19:10:47 +01:00
parent 0b4d27f398
commit e04b0d44dd
+4 -3
View File
@@ -4,7 +4,7 @@ import { useMutation } from '@apollo/client';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import { useState } from 'react'; import { useState } from 'react';
import { tokenVar, roleVar, userVar } from '../../../graphql/state'; import { tokenVar, roleVar, userVar } from '../../../graphql/state';
import { Google, Login as LoginIllustration, Logo } from '../../../assets'; import { Login as LoginIllustration, Logo } from '../../../assets';
import { Alert, Box, Button, Input, Link, Text } from '../../../components'; import { Alert, Box, Button, Input, Link, Text } from '../../../components';
import { theme } from '../../../themes'; import { theme } from '../../../themes';
import { Wrapper } from './styles'; import { Wrapper } from './styles';
@@ -38,6 +38,7 @@ const Login = () => {
} }
tokenVar(token); tokenVar(token);
userVar(user); userVar(user);
localStorage.setItem('token', token);
history.push('/'); history.push('/');
}, },
onError({ graphQLErrors }) { onError({ graphQLErrors }) {
@@ -134,13 +135,13 @@ const Login = () => {
loading={loading} loading={loading}
disabled={loading} disabled={loading}
/> />
<Button {/* <Button
variant='secondary-action' variant='secondary-action'
fullWidth fullWidth
color='client' color='client'
text='Login with Google' text='Login with Google'
iconLeft={<Google />} iconLeft={<Google />}
/> /> */}
</Box> </Box>
<Box display='flex' flexDirection='row'> <Box display='flex' flexDirection='row'>
<Box flexGrow='1'> <Box flexGrow='1'>