Spaces:
Running
Running
axeronis commited on
Commit ·
4f2852f
1
Parent(s): fa1d3dc
Fix: use window.location for reliable redirect after registration
Browse files
frontend/contexts/AuthContext.tsx
CHANGED
|
@@ -248,7 +248,15 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
|
| 248 |
|
| 249 |
// If verification is pending, redirect to verify page
|
| 250 |
if (data.access_token === 'verification_pending') {
|
| 251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
return
|
| 253 |
}
|
| 254 |
|
|
|
|
| 248 |
|
| 249 |
// If verification is pending, redirect to verify page
|
| 250 |
if (data.access_token === 'verification_pending') {
|
| 251 |
+
console.log('✅ [Register] Registration successful, redirecting to verify-email')
|
| 252 |
+
console.log('📧 [Register] Email:', email)
|
| 253 |
+
|
| 254 |
+
// Use window.location for immediate, reliable redirect
|
| 255 |
+
if (typeof window !== 'undefined') {
|
| 256 |
+
const verifyUrl = `/verify-email?email=${encodeURIComponent(email)}`
|
| 257 |
+
console.log('🔄 [Register] Redirecting to:', verifyUrl)
|
| 258 |
+
window.location.href = verifyUrl
|
| 259 |
+
}
|
| 260 |
return
|
| 261 |
}
|
| 262 |
|