Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set token in request for access from handler #124

Merged
merged 2 commits into from
Nov 18, 2015

Conversation

mcortesi
Copy link
Contributor

We set the jwt token on successful authentication in the request object.
It is stored in request.auth.token.

This allows access to the token from handler. It can be used, for
example to proxy request to another server using the user's token,
without needing to issue a new one.

@mcortesi
Copy link
Contributor Author

Check #123 for the discussion.

@nelsonic this implements exposing the token in request.auth.token and in request.auth.artifacts. If you want it any other way, let me know.

@nelsonic
Copy link
Member

@mcortesi looks good.
we will need to add a small section of documentation to the Readme to inform new people that the token is now available throughout the request lifecycle if people need it. similar to: https://github.com/dwyl/hapi-auth-jwt2#want-to-sendstore-your-jwt-in-a-cookie

We set the jwt token on successful authentication in the request object.
It is stored in request.auth.token.

This allows access to the token from handler. It can be used, for
example to proxy request to another server using the user's token,
without needing to issue a new one.
@mcortesi
Copy link
Contributor Author

@nelsonic done!

I updated the package version following you instructions, but i saw that you edited the comment, so I put them in another commit just in case.

The README is now part of the initial commit.

@nelsonic
Copy link
Member

Sweet. looks good. 👍

nelsonic added a commit that referenced this pull request Nov 18, 2015
Set token in request for access from handler
@nelsonic nelsonic merged commit eb9fff9 into dwyl:master Nov 18, 2015
@nelsonic
Copy link
Member

@mcortesi latest version is on NPM: 5.2.1 thanks again for using the Plugin.
please ⭐ the repo.

@mcortesi mcortesi deleted the access-token-from-request branch November 19, 2015 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants