Skip to content

Commit

Permalink
fix(bearer-auth): typo (#3404)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe authored Sep 11, 2024
1 parent c240ea5 commit 743f66c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/middleware/bearer-auth/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('Bearer Auth by Middleware', () => {
'/auth-custom-invalid-authentication-header-message-string/*',
bearerAuth({
token,
invalidAuthenticationHeaderMeasage:
invalidAuthenticationHeaderMessage:
'Custom invalid authentication header message as string',
})
)
Expand All @@ -139,7 +139,7 @@ describe('Bearer Auth by Middleware', () => {
'/auth-custom-invalid-authentication-header-message-object/*',
bearerAuth({
token,
invalidAuthenticationHeaderMeasage: {
invalidAuthenticationHeaderMessage: {
message: 'Custom invalid authentication header message as object',
},
})
Expand All @@ -153,7 +153,7 @@ describe('Bearer Auth by Middleware', () => {
'/auth-custom-invalid-authentication-header-message-function-string/*',
bearerAuth({
token,
invalidAuthenticationHeaderMeasage: () =>
invalidAuthenticationHeaderMessage: () =>
'Custom invalid authentication header message as function string',
})
)
Expand All @@ -166,7 +166,7 @@ describe('Bearer Auth by Middleware', () => {
'/auth-custom-invalid-authentication-header-message-function-object/*',
bearerAuth({
token,
invalidAuthenticationHeaderMeasage: () => ({
invalidAuthenticationHeaderMessage: () => ({
message: 'Custom invalid authentication header message as function object',
}),
})
Expand Down
6 changes: 3 additions & 3 deletions src/middleware/bearer-auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type BearerAuthOptions =
headerName?: string
hashFunction?: Function
noAuthenticationHeaderMessage?: string | object | MessageFunction
invalidAuthenticationHeaderMeasage?: string | object | MessageFunction
invalidAuthenticationHeaderMessage?: string | object | MessageFunction
invalidTokenMessage?: string | object | MessageFunction
}
| {
Expand All @@ -33,7 +33,7 @@ type BearerAuthOptions =
verifyToken: (token: string, c: Context) => boolean | Promise<boolean>
hashFunction?: Function
noAuthenticationHeaderMessage?: string | object | MessageFunction
invalidAuthenticationHeaderMeasage?: string | object | MessageFunction
invalidAuthenticationHeaderMessage?: string | object | MessageFunction
invalidTokenMessage?: string | object | MessageFunction
}

Expand Down Expand Up @@ -127,7 +127,7 @@ export const bearerAuth = (options: BearerAuthOptions): MiddlewareHandler => {
c,
400,
`${wwwAuthenticatePrefix}error="invalid_request"`,
options.invalidAuthenticationHeaderMeasage || 'Bad Request'
options.invalidAuthenticationHeaderMessage || 'Bad Request'
)
} else {
let equal = false
Expand Down

0 comments on commit 743f66c

Please sign in to comment.