Version: 0.9.83.dev.260508
后端: 1.关闭了注册接口 前端: 1.改造了主页 仓库: 1.对部署做了一些改善
This commit is contained in:
@@ -85,7 +85,11 @@ func RegisterRouters(
|
||||
})
|
||||
})
|
||||
|
||||
userauthapi.RegisterRoutes(apiGroup, userauthapi.NewUserHandler(authClient, userauthapi.NewGeeTestServiceFromConfig()), authClient, limiter)
|
||||
userauthapi.RegisterRoutes(apiGroup, userauthapi.NewUserHandler(
|
||||
authClient,
|
||||
userauthapi.NewGeeTestServiceFromConfig(),
|
||||
readUserAuthAllowRegister(),
|
||||
), authClient, limiter)
|
||||
forumapi.RegisterRoutes(apiGroup, forumapi.NewHandler(forumClient), authClient, cache, limiter)
|
||||
tokenstoreapi.RegisterRoutes(apiGroup, tokenstoreapi.NewHandler(tokenStoreClient), authClient, cache, limiter)
|
||||
|
||||
@@ -231,3 +235,12 @@ func compactConfigList(values []string) []string {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func readUserAuthAllowRegister() bool {
|
||||
// 1. 缺省保持“允许注册”,避免历史未补配置的环境升级后被静默改行为。
|
||||
// 2. 只有显式把 userauth.allowRegister 设成 false,才真正关闭注册入口。
|
||||
if !viper.IsSet("userauth.allowRegister") {
|
||||
return true
|
||||
}
|
||||
return viper.GetBool("userauth.allowRegister")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user