fix: skip-auth-prefixes not apply on listeners when users is unset

This commit is contained in:
wwqgtxx
2024-09-27 18:10:05 +08:00
parent 88bfe7cffe
commit cd2d1c6bb0
11 changed files with 70 additions and 49 deletions

View File

@@ -127,7 +127,7 @@ func initInnerTcp() {
func GetGeneral() *config.General {
ports := listener.GetPorts()
var authenticator []string
if auth := authStore.Authenticator(); auth != nil {
if auth := authStore.Default.Authenticator(); auth != nil {
authenticator = auth.Users()
}
@@ -422,7 +422,7 @@ func updateGeneral(general *config.General) {
func updateUsers(users []auth.AuthUser) {
authenticator := auth.NewAuthenticator(users)
authStore.SetAuthenticator(authenticator)
authStore.Default.SetAuthenticator(authenticator)
if authenticator != nil {
log.Infoln("Authentication of local server updated")
}