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

[Question] Claims in middleware creation #6

Open
gperdomor opened this issue Aug 29, 2017 · 2 comments
Open

[Question] Claims in middleware creation #6

gperdomor opened this issue Aug 29, 2017 · 2 comments

Comments

@gperdomor
Copy link

Hi @anthonycastelli

Why the second parameter is an empty array instead some array of claims?:

let tokenMiddleware = PayloadAuthenticationMiddleware(self.droplet.signer!,[], User.self)

@anthonycastelli
Copy link
Owner

My understanding is this was an optional parameter. Since the JWT token during generation has the parameters already being passed, you don't have to repeat it here.

@gperdomor
Copy link
Author

but inside the middleware, in the respond function exist this line _ = try req.jwt(verifyUsing: signer, and: self.claims) where self.claims is the parameter passed in the constructor... It's a little weird xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants