feat: token based authentication, authenticate route, token storage
This commit is contained in:
@@ -25,6 +25,8 @@ func (app *application) routes() http.Handler {
|
||||
router.HandlerFunc(http.MethodDelete, "/v1/movies/:id", app.deleteMovieHandler)
|
||||
router.HandlerFunc(http.MethodPost, "/v1/users", app.registerUserHandler)
|
||||
router.HandlerFunc(http.MethodPut, "/v1/users/activated", app.activateUserHandler)
|
||||
router.HandlerFunc(http.MethodPost, "/v1/tokens/authentication", app.createAuthenticationTokenHandler)
|
||||
// Wrap the router with the rateLimit() middleware.
|
||||
return app.recoverPanic(app.rateLimit(router))
|
||||
// Use the authenticate() middleware on all requests.
|
||||
return app.recoverPanic(app.rateLimit(app.authenticate(router)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user