@@ -20,7 +20,6 @@ import (
2020 "github.com/tidwall/buntdb"
2121 "github.com/xdg-go/scram"
2222
23- "github.com/ergochat/ergo/irc/caps"
2423 "github.com/ergochat/ergo/irc/connection_limits"
2524 "github.com/ergochat/ergo/irc/email"
2625 "github.com/ergochat/ergo/irc/migrations"
@@ -1398,10 +1397,6 @@ func (am *AccountManager) AuthenticateByPassphrase(client *Client, accountName s
13981397 }
13991398 }
14001399
1401- if strings .HasPrefix (accountName , caps .BearerTokenPrefix ) {
1402- return am .AuthenticateByBearerToken (client , strings .TrimPrefix (accountName , caps .BearerTokenPrefix ), passphrase )
1403- }
1404-
14051400 if throttled , remainingTime := client .checkLoginThrottle (); throttled {
14061401 return & ThrottleError {remainingTime }
14071402 }
@@ -1448,11 +1443,14 @@ func (am *AccountManager) AuthenticateByBearerToken(client *Client, tokenType, t
14481443func (am * AccountManager ) AuthenticateByOAuthBearer (client * Client , opts oauth2.OAuthBearerOptions ) (err error ) {
14491444 config := am .server .Config ()
14501445
1451- // we need to check this here since we can get here via SASL PLAIN:
14521446 if ! config .Accounts .OAuth2 .Enabled {
14531447 return errFeatureDisabled
14541448 }
14551449
1450+ if throttled , remainingTime := client .checkLoginThrottle (); throttled {
1451+ return & ThrottleError {remainingTime }
1452+ }
1453+
14561454 var username string
14571455 if config .Accounts .AuthScript .Enabled && config .Accounts .OAuth2 .AuthScript {
14581456 username , err = am .authenticateByOAuthBearerScript (client , config , opts )
@@ -2220,6 +2218,7 @@ var (
22202218 "EXTERNAL" : authExternalHandler ,
22212219 "SCRAM-SHA-256" : authScramHandler ,
22222220 "OAUTHBEARER" : authOauthBearerHandler ,
2221+ "IRCV3BEARER" : authIRCv3BearerHandler ,
22232222 }
22242223)
22252224
0 commit comments