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

includes JWT provider #4

Merged
merged 2 commits into from
Jun 2, 2017
Merged

includes JWT provider #4

merged 2 commits into from
Jun 2, 2017

Conversation

juliocbcotta
Copy link
Contributor

No description provided.

@@ -12,6 +12,10 @@ import AuthProvider
import JWT

final class UserController {
var droplet: Droplet
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is being initialized right away, there isn't a need to have it as a var You can make it a constant

let payload: [Claim] = [time, SubjectClaim(string: "\(userId)")]
let jwt = try JWT(payload: JSON(payload), signer: HS256(key: "SIGNING_KEY".makeBytes()))
return try jwt.createToken()
return try droplet.createJwtToken(String(userId))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having a whole separate function for this extension on the droplet, can you move it in to the registration and login methods?

@anthonycastelli anthonycastelli merged commit 91b7763 into anthonycastelli:master Jun 2, 2017
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

Successfully merging this pull request may close these issues.

2 participants