Skip to content

Commit

Permalink
[SOK-32]
Browse files Browse the repository at this point in the history
*remove timeout for redirects
  • Loading branch information
gloginov committed Oct 10, 2024
1 parent cbf937a commit 723d177
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions packages/client/src/components/hoc/withAuthUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ export default function withAuthUser<P extends object>(
const { pathname } = location

const successAuth = (redirectTo: string) => {
toast.success('Вы уже авторизованы', {
autoClose: 1500,
onClose: () => {
navigate(redirectTo)
},
})
toast.success('Вы уже авторизованы')
navigate(redirectTo)
}

useEffect(() => {
Expand All @@ -49,12 +45,8 @@ export default function withAuthUser<P extends object>(
window.sessionStorage.setItem('userIsLogged', '0') // 1

if (!['/sign-in', '/sign-up'].includes(pathname)) {
toast.error('Необходимо авторизоваться', {
autoClose: 1500,
onClose: () => {
navigate('/sign-in')
},
})
toast.error('Необходимо авторизоваться')
navigate('/sign-in')
}
})
} else if (redirectTo) {
Expand Down

0 comments on commit 723d177

Please sign in to comment.