Merge pull request #1785 from spotify/rugvip/salmon

auth-backend: set SameSite=Lax for oauth flow cookies
This commit is contained in:
Patrik Oldsberg
2020-07-30 15:10:50 +02:00
committed by GitHub
@@ -248,7 +248,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers {
res.cookie(`${this.options.providerId}-nonce`, nonce, {
maxAge: TEN_MINUTES_MS,
secure: this.options.secure,
sameSite: 'none',
sameSite: 'lax',
domain: this.domain,
path: `${this.basePath}/${this.options.providerId}/handler`,
httpOnly: true,
@@ -259,7 +259,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers {
res.cookie(`${this.options.providerId}-scope`, scope, {
maxAge: TEN_MINUTES_MS,
secure: this.options.secure,
sameSite: 'none',
sameSite: 'lax',
domain: this.domain,
path: `${this.basePath}/${this.options.providerId}/handler`,
httpOnly: true,
@@ -277,7 +277,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers {
res.cookie(`${this.options.providerId}-refresh-token`, refreshToken, {
maxAge: THOUSAND_DAYS_MS,
secure: this.options.secure,
sameSite: 'none',
sameSite: 'lax',
domain: this.domain,
path: `${this.basePath}/${this.options.providerId}`,
httpOnly: true,
@@ -288,7 +288,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers {
res.cookie(`${this.options.providerId}-refresh-token`, '', {
maxAge: 0,
secure: false,
sameSite: 'none',
sameSite: 'lax',
domain: `${this.domain}`,
path: `${this.basePath}/${this.options.providerId}`,
httpOnly: true,