WIP - fix browser refresh not holding user authentication
This commit is contained in:
@@ -56,15 +56,15 @@ export default defineEventHandler(async (event) => {
|
||||
setSessionCookie(event, access_token)
|
||||
|
||||
// Set tenant ID cookie (readable by client for context)
|
||||
if (tenantId) {
|
||||
setTenantIdCookie(event, tenantId)
|
||||
}
|
||||
// Use tenantId from response, or fall back to subdomain
|
||||
const tenantToStore = tenantId || subdomain
|
||||
setTenantIdCookie(event, tenantToStore)
|
||||
|
||||
// Return user info (but NOT the token - it's in HTTP-only cookie)
|
||||
return {
|
||||
success: true,
|
||||
user,
|
||||
tenantId,
|
||||
tenantId: tenantToStore,
|
||||
}
|
||||
} catch (error: any) {
|
||||
// Re-throw H3 errors
|
||||
|
||||
Reference in New Issue
Block a user