Skip to content

Commit ef8be4b

Browse files
committed
fix: honour redirect param on password login for OAuth flow
1 parent 590b08e commit ef8be4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/login/LoginForm.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ export default function LoginForm() {
4747
localStorage.setItem('auth_token', data.token);
4848
}
4949

50-
// Redirect based on admin status
51-
if (data.merchant?.is_admin) {
50+
// Redirect: honour OAuth / external redirect if present
51+
if (redirectTo) {
52+
router.push(redirectTo);
53+
} else if (data.merchant?.is_admin) {
5254
router.push('/admin');
5355
} else {
5456
router.push('/dashboard');

0 commit comments

Comments
 (0)