fix(login): ensure auth request information is up-to-date in external user check (#6060)

This commit is contained in:
Livio Spring
2023-06-21 07:00:03 +02:00
committed by GitHub
parent 7046194530
commit 84085478ec
2 changed files with 9 additions and 8 deletions

View File

@@ -247,6 +247,8 @@ func (repo *AuthRequestRepo) CheckExternalUserLogin(ctx context.Context, authReq
}
err = repo.checkExternalUserLogin(ctx, request, externalUser.IDPConfigID, externalUser.ExternalUserID)
if errors.IsNotFound(err) {
// clear potential user information (e.g. when username was entered but another external user was returned)
request.SetUserInfo("", "", "", "", "", request.UserOrgID)
if err := repo.setLinkingUser(ctx, request, externalUser); err != nil {
return err
}