You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module does not provide an authentication strategy, but it provides a very fast utility to handle authentication (and multiple strategies) in your routes, without adding overhead.
8
-
Check out a complete example [here](https://github.com/fastify/fastify-auth/blob/master/example.js).
8
+
Check out a complete example [here](test/example.js).
9
9
10
10
## Install
11
11
```
@@ -72,7 +72,7 @@ fastify
72
72
})
73
73
})
74
74
```
75
-
_For more examples, please check [`example-composited.js`](example-composited.js)_
75
+
_For more examples, please check [`example-composited.js`](test/example-composited.js)_
76
76
77
77
This plugin support `callback` and `Promise` returned by the functions. Note that an `async` function **does not have** to call the `done` parameter, otherwise the route handler to which the auth methods are linked to [might be called multiple times](https://www.fastify.io/docs/latest/Hooks/#respond-to-a-request-from-a-hook):
78
78
```js
@@ -105,7 +105,7 @@ fastify
105
105
106
106
107
107
Keep in mind that route definition should either be done as [a plugin](https://github.com/fastify/fastify/blob/master/docs/Plugins.md) or within an `.after()` callback.
108
-
For a complete example implementation, see [example.js](example.js).
108
+
For a complete example implementation, see [example.js](test/example.js).
109
109
110
110
`@fastify/auth` will run all your authentication methods and your request will continue if at least one succeeds, otherwise it will return an error to the client.
111
111
Any successful authentication will automatically stop `@fastify/auth` from trying the rest, unless you provide the `run: 'all'` parameter:
0 commit comments