feat(frontend): Implement HttpOnly cookie authentication and API v1 integration. Update AuthService for cookie-based session management, configure Axios with v1 prefix and credentials, and enhance OIDC callback logic.
This commit is contained in:
@@ -7,9 +7,18 @@ export function AuthCallback() {
|
||||
|
||||
useEffect(() => {
|
||||
const verifyAuth = async () => {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const code = urlParams.get("code")
|
||||
|
||||
try {
|
||||
// The cookie should have been set by the backend redirect
|
||||
await AuthService.getMe()
|
||||
if (code) {
|
||||
// If we have a code, exchange it for a cookie
|
||||
await AuthService.exchangeOIDCCode(code)
|
||||
} else {
|
||||
// If no code, just verify existing cookie (backend-driven redirect)
|
||||
await AuthService.getMe()
|
||||
}
|
||||
|
||||
// Success - go to home. We use window.location.href to ensure a clean reload of App state
|
||||
window.location.href = "/"
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user