forked from github/plane
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:
parent
c0263acb8a
commit
5cbb3ecd4d
@ -70,11 +70,10 @@ export const EmailCodeForm = ({ onSuccess }: any) => {
|
|||||||
onSuccess(response);
|
onSuccess(response);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Oops!",
|
title: "Oops!",
|
||||||
type: "error",
|
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, {
|
setError("token" as keyof EmailCodeFormValues, {
|
||||||
type: "manual",
|
type: "manual",
|
||||||
|
@ -35,10 +35,11 @@ const SignInPage: NextPage = () => {
|
|||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
const onSignInSuccess = useCallback(async () => {
|
const onSignInSuccess = useCallback(async () => {
|
||||||
|
setLoading(true);
|
||||||
await mutateUser();
|
await mutateUser();
|
||||||
const nextLocation = router.asPath.split("?next=")[1];
|
const nextLocation = router.asPath.split("?next=")[1];
|
||||||
if (nextLocation) router.push(nextLocation as string);
|
if (nextLocation) await router.push(nextLocation as string);
|
||||||
else router.push("/");
|
else await router.push("/");
|
||||||
}, [mutateUser, router]);
|
}, [mutateUser, router]);
|
||||||
|
|
||||||
const handleGoogleSignIn = ({ clientId, credential }: any) => {
|
const handleGoogleSignIn = ({ clientId, credential }: any) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user