Skip to content

Commit

Permalink
debug dbauth cookie issue on Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jun 27, 2024
1 parent e9a52a7 commit e3f3aff
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,25 @@ export class DbAuthHandler<
get _deleteSessionHeader(): Headers {
const deleteHeaders = new Headers()

console.log('')
console.log('------')
console.log(
'_deleteSessionHeader cookie string',
[
`${cookieName(this.options.cookie?.name)}=`,
...this._cookieAttributes({ expires: 'now' }),
].join(';'),
)
console.log('')
console.log(
'_deleteSessionHeader auth-provider string',
[`auth-provider=`, ...this._cookieAttributes({ expires: 'now' })].join(
';',
),
)
console.log('------')
console.log('')

deleteHeaders.append(
'set-cookie',
[
Expand Down Expand Up @@ -1520,6 +1539,11 @@ export class DbAuthHandler<

const headers = new Headers()

console.log(
'_loginResponse cookie string',
this._createAuthProviderCookieString(),
)

headers.append('csrf-token', csrfToken)
headers.append('set-cookie', this._createAuthProviderCookieString())
headers.append(
Expand Down

0 comments on commit e3f3aff

Please sign in to comment.