You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I have an auth flow consisting of several endpoint functions. For this specific bug two of them are important.
src/pages/auth/login.ts:
exportconstprerender=false;import{defaultCookieOptions,getAuthorizationUrl,OIDC_COOKIES,}from"@lib/auth.ts";importtype{APIRoute}from"astro";import{generateRandomCodeVerifier}from"oauth4webapi";exportconstGET: APIRoute=async({ redirect, cookies })=>{constcode_verifier=generateRandomCodeVerifier();cookies.set(OIDC_COOKIES.CodeVerifier,code_verifier,defaultCookieOptions);cookies.set(OIDC_COOKIES.State,'placeholder',defaultCookieOptions);constauthorizationUrl=awaitgetAuthorizationUrl(code_verifier,state);returnredirect(authorizationUrl.toString());};
When deploying this on Vercel the first login page successfuly sets the cookies and redirects to the SSO but the second function instead deletes all cookies:
During local development this works fine. The interesting part is that the second function deletes all cookies, even those that weren't touched in anyway during the function execution.
The above function use following cookie configuration:
I would expect the callback.ts endpoint but be able to set the cookies just as the login.ts endpoint.
Link to Minimal Reproducible Example
I can spend some time on this in follow-up days but given that this issue occures only when deploying to vercel this is slightly more complex. Opening this in the meantime in case somebody encountered the same issue and/or knows what might be the cause.
Participation
I am willing to submit a pull request for this issue.
The text was updated successfully, but these errors were encountered:
So the issue seemed to be with routes src/pages/auth/logout/callback.ts and src/pages/auth/callback.ts getting bundled into one function and logout taking precedence, closing as a duplicate of: #8401
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I have an auth flow consisting of several endpoint functions. For this specific bug two of them are important.
src/pages/auth/login.ts
:and
src/pages/auth/callback.ts
:When deploying this on Vercel the first
login
page successfuly sets the cookies and redirects to the SSO but the second function instead deletes all cookies:During local development this works fine. The interesting part is that the second function deletes all cookies, even those that weren't touched in anyway during the function execution.
The above function use following cookie configuration:
What's the expected result?
I would expect the
callback.ts
endpoint but be able to set the cookies just as thelogin.ts
endpoint.Link to Minimal Reproducible Example
I can spend some time on this in follow-up days but given that this issue occures only when deploying to vercel this is slightly more complex. Opening this in the meantime in case somebody encountered the same issue and/or knows what might be the cause.
Participation
The text was updated successfully, but these errors were encountered: