Skip to content

Commit 579a83b

Browse files
committed
Touch-ups
1 parent 1bc4a2b commit 579a83b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ sent to the client (optional)
4646
`application/json`, then the `contentType` property must be set (optional)
4747
* `bearerType`: string specifying the Bearer string (optional)
4848
* `function auth (key, req) {}` : this function will test if `key` is a valid token.
49-
The function must return literal `true` if the key is accepted or literal `false`
50-
if rejected. The function may return also a promise that resolves to one of this
51-
values. If the function returns or resolves to another value, rejects or throws
52-
it will send an HTTP status 500. `req` will contain the request object. If `auth`
53-
is a function, `keys` will be ignored. If `auth` is not a function or undefined,
54-
`keys` will be used.
49+
The function must return a literal `true` if the key is accepted or a literal
50+
`false` if rejected. The function may return also a promise that resolves to
51+
one of these values. If the function returns or resolves to any other value,
52+
rejects, or throws a HTTP status of `500` will be sent. `req` is the Fastify
53+
request object. If `auth` is a function, `keys` will be ignored. If `auth` is
54+
not a function, or `undefined`, `keys` will be used.
5555

5656
The default configuration object is:
5757

test/hook.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ test('hook rejects wrong token with function (resolved promise)', (t) => {
294294
})
295295
})
296296

297-
test('hook rejects with 500 when functions fails', (t) => {
297+
test('hook rejects with 500 when functions fails', (t) => {
298298
t.plan(4)
299299

300300
const auth = function (val) {
@@ -327,7 +327,7 @@ test('hook rejects with 500 when functions fails', (t) => {
327327
})
328328
})
329329

330-
test('hook rejects with 500 when promise rejects', (t) => {
330+
test('hook rejects with 500 when promise rejects', (t) => {
331331
t.plan(4)
332332

333333
const auth = function (val) {
@@ -360,7 +360,7 @@ test('hook rejects with 500 when promise rejects', (t) => {
360360
})
361361
})
362362

363-
test('hook rejects with 500 when functions returns non-boolean', (t) => {
363+
test('hook rejects with 500 when functions returns non-boolean', (t) => {
364364
t.plan(4)
365365

366366
const auth = function (val) {
@@ -393,7 +393,7 @@ test('hook rejects with 500 when functions returns non-boolean', (t) => {
393393
})
394394
})
395395

396-
test('hook rejects with 500 when promise resolves to non-boolean', (t) => {
396+
test('hook rejects with 500 when promise resolves to non-boolean', (t) => {
397397
t.plan(4)
398398

399399
const auth = function (val) {

0 commit comments

Comments
 (0)