From dc888bf959d9ac30418ec5d836a0146d5a41f058 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Mon, 22 Aug 2016 20:14:21 +0100 Subject: [PATCH] Document availability of request.auth.token in verifyFunc() closes https://github.com/dwyl/hapi-auth-jwt2/issues/184 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 406d11d..0ac14dc 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,14 @@ signature `function(decoded, callback)` where: - `tokenType` - (***optional*** *defaults to none*) - allow custom token type, e.g. `Authorization: 12345678`. - `complete` - (***optional*** *defaults to* `false`) - set to `true` to receive the complete token (`decoded.header`, `decoded.payload` and `decoded.signature`) as `decoded` argument to key lookup and `verifyFunc` callbacks (*not `validateFunc`*) +### Useful Features + ++ The *encoded* JWT (token) is extracted from the headers of the request and +made available on the `request` object as `request.auth.token`, +in case you need it later on in the request lifecycle. +This feature was requested by @mcortesi in +[hapi-auth-jwt2/issues/123](https://github.com/dwyl/hapi-auth-jwt2/issues/123) + ### Understanding the Request Flow