-
Notifications
You must be signed in to change notification settings - Fork 0
BE-18 Email confirmation #1
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
Conversation
@@ -0,0 +1,78 @@ | |||
### Running the app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for readme
cmd/users-api/main.go
Outdated
@@ -50,7 +50,7 @@ func startWebAPI(logger zerolog.Logger, settings *config.Settings, pdb database. | |||
}, | |||
DisableStartupMessage: true, | |||
}) | |||
usersController := controllers.NewUsersController(settings, pdb.DBS, &logger) | |||
usersController := controllers.NewUserController(settings, pdb.DBS, &logger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're going to name it singular may also wish to change the name of the variable to userController
for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that one.
token := c.Locals("user").(*jwt.Token) | ||
claims := token.Claims.(jwt.MapClaims) | ||
userID := claims["sub"].(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be in a helper method.. could definitely see that one being part of our library too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be middleware. Coming!
return nil | ||
} | ||
|
||
func init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need an init function? Kinda frowned upon these days - they were even trying to remove them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to not use them. I'm glad the linked proposal was shot down, though.
My use is that I have a constant time.Duration
that I want to keep using, and I don't want to keep re-parsing the string that defines it. It wouldn't hurt to shove the difference in the controller struct.
- userID helper - Rename users -> user - Get rid of init()
No description provided.