1
0
Fork 0
forked from External/ergo

remove draft/bearer in favor of IRCV3BEARER

This commit is contained in:
Shivaram Lingamneni 2024-05-27 20:40:04 -04:00
parent 5ee32cda1c
commit ed683bff79
6 changed files with 30 additions and 35 deletions

View file

@ -1402,6 +1402,9 @@ func LoadConfig(filename string) (config *Config, err error) {
if config.Accounts.OAuth2.Enabled {
saslCapValues = append(saslCapValues, "OAUTHBEARER")
}
if config.Accounts.OAuth2.Enabled || config.Accounts.JWTAuth.Enabled {
saslCapValues = append(saslCapValues, "IRCV3BEARER")
}
config.Server.capValues[caps.SASL] = strings.Join(saslCapValues, ",")
} else {
config.Server.supportedCaps.Disable(caps.SASL)
@ -1419,19 +1422,6 @@ func LoadConfig(filename string) (config *Config, err error) {
return nil, fmt.Errorf("oauth2 is enabled with auth-script, but no auth-script is enabled")
}
var bearerCapValues []string
if config.Accounts.OAuth2.Enabled {
bearerCapValues = append(bearerCapValues, "oauth2")
}
if config.Accounts.JWTAuth.Enabled {
bearerCapValues = append(bearerCapValues, "jwt")
}
if len(bearerCapValues) != 0 {
config.Server.capValues[caps.Bearer] = strings.Join(bearerCapValues, ",")
} else {
config.Server.supportedCaps.Disable(caps.Bearer)
}
if !config.Accounts.Registration.Enabled {
config.Server.supportedCaps.Disable(caps.AccountRegistration)
} else {