mirror of
https://github.com/honojs/hono.git
synced 2024-11-24 11:07:29 +01:00
fix(bearer-auth): typo (#3404)
This commit is contained in:
parent
c240ea5590
commit
743f66c13a
@ -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',
|
||||
})
|
||||
)
|
||||
@ -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',
|
||||
},
|
||||
})
|
||||
@ -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',
|
||||
})
|
||||
)
|
||||
@ -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',
|
||||
}),
|
||||
})
|
||||
|
@ -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
|
||||
}
|
||||
| {
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user