added refresh tocken
This commit is contained in:
+2
-1
@@ -56,7 +56,7 @@ func main() {
|
||||
log.Printf("warning: failed to ensure indexes: %v", err)
|
||||
}
|
||||
|
||||
svc := auth.NewService(repo, cfg.JWTSecret, cfg.JWTExpiration)
|
||||
svc := auth.NewService(repo, cfg.JWTSecret, cfg.JWTExpiration, cfg.JWTRefreshExpiration)
|
||||
handler := auth.NewHandler(svc)
|
||||
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
@@ -76,6 +76,7 @@ func main() {
|
||||
{
|
||||
api.POST("/register", handler.Register)
|
||||
api.POST("/login", handler.Login)
|
||||
api.POST("/refresh", handler.Refresh)
|
||||
api.GET("/me", auth.AuthMiddleware([]byte(cfg.JWTSecret)), handler.Me)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user