Enforce LoginTypeApplicationService after all

This commit is contained in:
Neil Alexander 2021-03-04 15:58:47 +00:00
parent ff04a962f1
commit 2db487cdd3
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -502,7 +502,7 @@ func Register(
// Squash username to all lowercase letters
r.Username = strings.ToLower(r.Username)
if r.Auth.Type == authtypes.LoginTypeApplicationService || accessTokenErr == nil {
if r.Auth.Type == authtypes.LoginTypeApplicationService {
if resErr = validateApplicationServiceUsername(r.Username); resErr != nil {
return *resErr
}
@ -604,7 +604,7 @@ func handleRegistrationFlow(
// registration or user exclusivity. We'll go onto the appservice
// registration flow if a valid access token was provided or if
// the login type specifically requests it.
if r.Auth.Type == authtypes.LoginTypeApplicationService || accessTokenErr == nil {
if r.Auth.Type == authtypes.LoginTypeApplicationService {
return handleApplicationServiceRegistration(
accessToken, accessTokenErr, req, r, cfg, userAPI,
)