Skip to content

Commit

Permalink
fix: show error on sign in page
Browse files Browse the repository at this point in the history
  • Loading branch information
yarre-uk committed Dec 18, 2023
1 parent 2d740da commit 8c79053
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/containers/sign-in/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ export default function SignInContainer() {
await signIn('credentials', {
login: data.login,
password: data.password,
redirect: true,
// redirect: true,
});

setTimeout(() => {
if (!searchParams.get('error')) {
router.replace(searchParams.get('callbackUrl') ?? ROUTE.HOME);
}
}, 50);
// setTimeout(() => {
// if (!searchParams.get('error') && searchParams.get('callbackUrl')) {
// router.replace(searchParams.get('callbackUrl') ?? ROUTE.HOME);
// }
// }, 100);
};

useEffect(() => {
Expand All @@ -84,6 +84,7 @@ export default function SignInContainer() {

useEffect(() => {
if (searchParams.get('error')) {
// console.log(searchParams.get('error'));
toast({
title: 'Signin error',
description: 'Some error has occurred whilst you were signing in',
Expand Down

0 comments on commit 8c79053

Please sign in to comment.