mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
fix: oauth2 redirect url not consistent (#930)
* fix: oauth2 redirect url not consistent * only use one redirect uri * feat: allow to disable password authentication * generate translation template * update error * redirect * query
This commit is contained in:
@@ -57,7 +57,6 @@ func routers(r *gin.Engine, frontendDist fs.FS) {
|
||||
api := r.Group("api/v1")
|
||||
api.POST("/login", authMiddleware.LoginHandler)
|
||||
api.GET("/oauth2/:provider", commonHandler(oauth2redirect))
|
||||
api.POST("/oauth2/:provider/callback", commonHandler(oauth2callback(authMiddleware)))
|
||||
|
||||
optionalAuth := api.Group("", optionalAuthMiddleware(authMiddleware))
|
||||
optionalAuth.GET("/ws/server", commonHandler(serverStream))
|
||||
@@ -67,6 +66,8 @@ func routers(r *gin.Engine, frontendDist fs.FS) {
|
||||
optionalAuth.GET("/service/:id", commonHandler(listServiceHistory))
|
||||
optionalAuth.GET("/service/server", commonHandler(listServerWithServices))
|
||||
|
||||
optionalAuth.GET("/oauth2/callback", commonHandler(oauth2callback(authMiddleware)))
|
||||
|
||||
optionalAuth.GET("/setting", commonHandler(listConfig))
|
||||
|
||||
auth := api.Group("", authMiddleware.MiddlewareFunc())
|
||||
@@ -81,7 +82,6 @@ func routers(r *gin.Engine, frontendDist fs.FS) {
|
||||
|
||||
auth.GET("/profile", commonHandler(getProfile))
|
||||
auth.POST("/profile", commonHandler(updateProfile))
|
||||
auth.POST("/oauth2/:provider/bind", commonHandler(bindOauth2))
|
||||
auth.POST("/oauth2/:provider/unbind", commonHandler(unbindOauth2))
|
||||
|
||||
auth.GET("/user", adminHandler(listUser))
|
||||
|
||||
Reference in New Issue
Block a user