Skip to content

Commit 203d9e4

Browse files
simonha9alaister
andauthored
bug: fix sign-in when returnTo=sign-in (supabase#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 <[email protected]>
1 parent e676a18 commit 203d9e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/studio/components/interfaces/SignIn/SignInForm.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ const SignInForm = () => {
5252

5353
toast.success(`Signed in successfully!`, { id: toastId })
5454
await queryClient.resetQueries()
55-
56-
router.push(getReturnToPath())
55+
const returnTo = getReturnToPath()
56+
// since we're already on the /sign-in page, prevent redirect loops
57+
router.push(returnTo === '/sign-in' ? '/projects' : returnTo)
5758
} catch (error) {
5859
toast.error((error as AuthError).message, { id: toastId })
5960
}

0 commit comments

Comments
 (0)