Skip to content

Commit

Permalink
Undo bearer token change
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Jan 19, 2024
1 parent 38b3584 commit 06c07dc
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions packages/auth-providers/dbAuth/api/src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,12 @@ export const dbAuthSession = (
cookieNameOption: string | undefined
) => {
const sessionCookie = extractCookie(event)
const bearerToken = extractEncryptedSessionFromHeader(event)

if (sessionCookie) {
// i.e. Browser making a request
const [session, _csrfToken] = decryptSession(
getSession(sessionCookie, cookieNameOption)
)
return session
} else if (bearerToken) {
// i.e. FE Sever makes the request, and adds encrypted session to the Authorization header
const [session, _csrfToken] = decryptSession(bearerToken)

return session
} else {
return null
Expand Down

0 comments on commit 06c07dc

Please sign in to comment.