mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
Check correct auth type field
This commit is contained in:
parent
2db487cdd3
commit
f7ab99a77f
|
|
@ -502,7 +502,7 @@ func Register(
|
|||
|
||||
// Squash username to all lowercase letters
|
||||
r.Username = strings.ToLower(r.Username)
|
||||
if r.Auth.Type == authtypes.LoginTypeApplicationService {
|
||||
if r.Type == authtypes.LoginTypeApplicationService && accessTokenErr == nil {
|
||||
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 {
|
||||
if r.Type == authtypes.LoginTypeApplicationService && accessTokenErr == nil {
|
||||
return handleApplicationServiceRegistration(
|
||||
accessToken, accessTokenErr, req, r, cfg, userAPI,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue