Skip to content

Commit

Permalink
More dbAuth console logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jun 27, 2024
1 parent 31c0e9e commit 50cfd14
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
20 changes: 20 additions & 0 deletions packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,14 @@ export class DbAuthHandler<
try {
const method = await this._getAuthMethod()

console.log('')
console.log('------')
console.log('')
console.log('invoke method', method)
console.log('')
console.log('------')
console.log('')

// get the auth method the incoming request is trying to call
if (!DbAuthHandler.METHODS.includes(method)) {
return buildDbAuthResponse(this._notFound(), corsHeaders)
Expand All @@ -553,6 +561,18 @@ export class DbAuthHandler<
const [body, headers, options = { statusCode: 200 }] =
await this[method]()

console.log('')
console.log('------')
console.log('')
console.log('invoke body', body)
console.log('')
console.log('invoke headers', headers)
console.log('')
console.log('invoke options', options)
console.log('')
console.log('------')
console.log('')

return buildDbAuthResponse(this._ok(body, headers, options), corsHeaders)
} catch (e: any) {
if (e instanceof DbAuthError.WrongVerbError) {
Expand Down
20 changes: 19 additions & 1 deletion packages/auth-providers/dbAuth/api/src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,15 @@ export const buildDbAuthResponse = (
) => {
const setCookieHeaders = response.headers?.getSetCookie() || []

return {
console.log('')
console.log('------')
console.log('')
console.log('setCookieHeaders', setCookieHeaders)
console.log('')
console.log('------')
console.log('')

const dbAuthResponse = {
...response,
headers: {
...Object.fromEntries(response.headers?.entries() || []),
Expand All @@ -287,6 +295,16 @@ export const buildDbAuthResponse = (
...corsHeaders,
},
}

console.log('')
console.log('------')
console.log('')
console.log('dbAuthResponse', dbAuthResponse)
console.log('')
console.log('------')
console.log('')

return dbAuthResponse
}

export const extractHashingOptions = (text: string): ScryptOptions => {
Expand Down

0 comments on commit 50cfd14

Please sign in to comment.