Skip to content

Commit

Permalink
style: showing user sign-in progress on sign-in with code (#311)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dakshesh14 committed Feb 21, 2023
1 parent c0263ac commit 5cbb3ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions apps/app/components/account/email-code-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ export const EmailCodeForm = ({ onSuccess }: any) => {
onSuccess(response);
})
.catch((error) => {
console.log(error);
setToastAlert({
title: "Oops!",
type: "error",
message: "Enter the correct code to sign in",
message: error?.response?.data?.error ?? "Enter the correct code to sign in",
});
setError("token" as keyof EmailCodeFormValues, {
type: "manual",
Expand Down
5 changes: 3 additions & 2 deletions apps/app/pages/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

1 comment on commit 5cbb3ec

@vercel
Copy link

@vercel vercel bot commented on 5cbb3ec Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-dev – ./apps/app

plane-dev-git-develop-caravel.vercel.app
plane-dev.vercel.app
plane-dev-caravel.vercel.app

Please sign in to comment.