Production Deployment Fixes and Enhancements #3

Merged
ilia merged 38 commits from dev into main 2026-01-04 16:37:35 -05:00
Showing only changes of commit f9bfa5febb - Show all commits

View File

@ -2,10 +2,8 @@
import { useState } from "react"
import { signIn } from "next-auth/react"
import { useRouter } from "next/navigation"
export default function LoginPage() {
const router = useRouter()
const [email, setEmail] = useState("")
const [password, setPassword] = useState("")
const [error, setError] = useState("")
@ -32,8 +30,9 @@ export default function LoginPage() {
const params = new URLSearchParams(window.location.search)
const callbackUrl = params.get("callbackUrl") || "/photos"
console.log("Redirecting to:", callbackUrl)
router.push(callbackUrl)
router.refresh()
// Use window.location.href to force a full page reload
// This ensures the session cookie is read before middleware checks authentication
window.location.href = callbackUrl
} else {
setError("Login failed. Please try again.")
}