1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

fix: oidc has a default oauth state

This commit is contained in:
diced 2025-02-17 11:56:14 -08:00
parent ec8e426964
commit a4b55d102a
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1

View file

@ -25,13 +25,14 @@ async function handler({ code, host, state }: OAuthQuery, _logger: Logger): Prom
if (!code) {
const linkState = encrypt('link', config.core.secret);
const defaultState = encrypt('default', config.core.secret);
return {
redirect: oidcAuth.url(
config.oauth.oidc.clientId!,
`${config.core.returnHttpsUrls ? 'https' : 'http'}://${host}`,
config.oauth.oidc.authorizeUrl!,
state === 'link' ? linkState : undefined,
state === 'link' ? linkState : defaultState,
config.oauth.oidc.redirectUri ?? undefined,
),
};