From 88c381e0fc1d67fd8f5ea4b0bc873a017152a809 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 3 Mar 2021 16:50:05 +0000 Subject: [PATCH] Tweak AS registration check --- clientapi/routing/register.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index 614e19d50..9e09d74d4 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -591,9 +591,10 @@ func handleRegistrationFlow( accessToken, accessTokenErr := auth.ExtractAccessToken(req) // Appservices are special and are not affected by disabled - // registration or user exclusivity. - if r.Auth.Type == authtypes.LoginTypeApplicationService || - (r.Auth.Type == "" && accessTokenErr == nil) { + // 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 { return handleApplicationServiceRegistration( accessToken, accessTokenErr, req, r, cfg, userAPI, )