Account for application service headers auth

This commit is contained in:
Andrew Morgan 2018-07-27 18:11:10 +01:00
parent c091a4bcb3
commit c594bbddb4

View file

@ -497,7 +497,8 @@ func Register(
// Application services can register users with no auth type, but require
// access token. Differentiate from users who are initially hitting register
// without an auth type
if r.Auth.Type == "" && req.URL.Query().Get("access_token") == "" {
if r.Auth.Type == "" && req.URL.Query().Get("access_token") == "" &&
req.Header.Get("Authorization") == "" {
return util.JSONResponse{
Code: http.StatusUnauthorized,
JSON: newUserInteractiveResponse(sessionID,