mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-10 21:48:52 +00:00
Clear old monitoring snapshots, logout endpoint
This commit is contained in:
@@ -77,6 +77,13 @@ func (api *WebAPI) Login(r *Request) {
|
||||
}).Info("Logged in")
|
||||
}
|
||||
|
||||
func (api *WebAPI) Logout(r *Request) {
|
||||
|
||||
sess := api.Session.StartFasthttp(r.Ctx)
|
||||
sess.Clear()
|
||||
r.Ctx.Response.SetStatusCode(204)
|
||||
}
|
||||
|
||||
func (api *WebAPI) Register(r *Request) {
|
||||
|
||||
req := &RegisterRequest{}
|
||||
|
||||
@@ -102,6 +102,7 @@ func New() *WebAPI {
|
||||
|
||||
api.router.POST("/register", LogRequestMiddleware(api.Register))
|
||||
api.router.POST("/login", LogRequestMiddleware(api.Login))
|
||||
api.router.GET("/logout", LogRequestMiddleware(api.Logout))
|
||||
api.router.GET("/account", LogRequestMiddleware(api.AccountDetails))
|
||||
|
||||
api.router.NotFound = func(ctx *fasthttp.RequestCtx) {
|
||||
|
||||
Reference in New Issue
Block a user