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
On your handler create/save token and pass it in a cookie
....//check your password, compare, create session and store in db, create token as JWT
...
returnredirect('/dashboard').state('name-of-your-token',token);
On your handler create/save token and pass it in a cookie for example.
```js
....
//check your password, compare, create session and store in db, create token as JWT
...
return redirect('/dashboard').state('token', token);
We dont need to specify cookieKey in above because as default is looking for 'token' - check L10
-register these plugins it to your server/index
-defined your customValidate function
We had an issue of not calling the validate function on one of the strategies (on some routes). Our token on that route was undefined. We resolved it by passing cookieKey with the correct name of the token.
The text was updated successfully, but these errors were encountered:
heron2014
changed the title
Multiple strategies with one scheme - 'jwt' in Hapi.js
Multiple strategies with one scheme - 'hapi-auth-jwt2' in Hapi.js
May 31, 2016
wip
If you want to register two different strategies depends on the routes, based on hapi-auth-jwt2scheme, follow these steps:
Create your plugins for 'some-strategy':
On your handler create/save token and pass it in a cookie
other plugin for different strategy
In a handler:
We dont need to specify cookieKey in above because as default is looking for 'token' - check L10
-register these plugins it to your server/index
-defined your customValidate function
We had an issue of not calling the validate function on one of the strategies (on some routes). Our token on that route was undefined. We resolved it by passing cookieKey with the correct name of the token.
The text was updated successfully, but these errors were encountered: