mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
bug: fix sign-in when returnTo=sign-in (#24893)
* bug: fix sign-in when returnTo=sign-in - default redirect to /projects instead * Update apps/studio/components/interfaces/SignIn/SignInForm.tsx --------- Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
This commit is contained in:
1 parent
e676a18b6c
commit
203d9e4c1e
1 file changed
+3
-2
@@ -52,8 +52,9 @@ const SignInForm = () => {
|
||||
|
||||
toast.success(`Signed in successfully!`, { id: toastId })
|
||||
await queryClient.resetQueries()
|
||||
|
||||
router.push(getReturnToPath())
|
||||
const returnTo = getReturnToPath()
|
||||
// since we're already on the /sign-in page, prevent redirect loops
|
||||
router.push(returnTo === '/sign-in' ? '/projects' : returnTo)
|
||||
} catch (error) {
|
||||
toast.error((error as AuthError).message, { id: toastId })
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user