Browse Source

add option to login upon scanning qr code

feature/qrscanner
Nareshkumar Rao 3 years ago
parent
commit
95d9c7f733
  1. 1
      .gitignore
  2. 3
      src/screens/CreateScreen.js
  3. 4
      src/screens/LoginScreen.js

1
.gitignore

@ -23,3 +23,4 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
.env.production

3
src/screens/CreateScreen.js

@ -1,5 +1,6 @@
import { import {
Button, Button,
Divider,
Flex, Flex,
FormControl, FormControl,
FormLabel, FormLabel,
@ -82,6 +83,8 @@ function Create() {
> >
<Flex direction="column" background="white" p={12} rounded={6}> <Flex direction="column" background="white" p={12} rounded={6}>
<Heading mb={6}>Create Account</Heading> <Heading mb={6}>Create Account</Heading>
<Button onClick={()=>{history.push("/login");}} mb={6}>I already have an account!</Button>
<Divider mb={6} />
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<FormControl mb={6}> <FormControl mb={6}>
<FormLabel>Telegram Username:</FormLabel> <FormLabel>Telegram Username:</FormLabel>

4
src/screens/LoginScreen.js

@ -57,7 +57,11 @@ function Login() {
if (response.data.authorized) { if (response.data.authorized) {
dispatch(authLogin()); dispatch(authLogin());
toast.closeAll(); toast.closeAll();
if(response.data.contactSuccess){
history.push('/success');
}else{
history.push('/home'); history.push('/home');
}
} else { } else {
dispatch(authLogout()); dispatch(authLogout());
toast({ toast({

Loading…
Cancel
Save