style: showing user sign-in progress on sign-in with code (#311)

* style: not showing pointer & theme color on resend code button disabled

* style: showing user sign-in progress on sign-in with code

* style: showing error from server on sign-in with code fail
This commit is contained in:
Dakshesh Jain 2023-02-21 19:14:12 +05:30 committed by GitHub
parent c0263acb8a
commit 5cbb3ecd4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -35,10 +35,11 @@ const SignInPage: NextPage = () => {
const { setToastAlert } = useToast();
const onSignInSuccess = useCallback(async () => {
setLoading(true);
await mutateUser();
const nextLocation = router.asPath.split("?next=")[1];
if (nextLocation) router.push(nextLocation as string);
else router.push("/");
if (nextLocation) await router.push(nextLocation as string);
else await router.push("/");
}, [mutateUser, router]);
const handleGoogleSignIn = ({ clientId, credential }: any) => {