mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-12 10:43:40 +00:00
parent
a19b4d2659
commit
56d5704749
@ -172,7 +172,10 @@ func (repo *AuthRequestRepo) CheckExternalUserLogin(ctx context.Context, authReq
|
||||
}
|
||||
err = repo.checkExternalUserLogin(request, externalUser.IDPConfigID, externalUser.ExternalUserID)
|
||||
if errors.IsNotFound(err) {
|
||||
return repo.setLinkingUser(ctx, request, externalUser)
|
||||
if err := repo.setLinkingUser(ctx, request, externalUser); err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -133,7 +133,10 @@ func (l *Login) handleExternalUserAuthenticated(w http.ResponseWriter, r *http.R
|
||||
externalUser := l.mapTokenToLoginUser(tokens, idpConfig)
|
||||
err := l.authRepo.CheckExternalUserLogin(r.Context(), authReq.ID, userAgentID, externalUser, model.BrowserInfoFromRequest(r))
|
||||
if err != nil {
|
||||
l.renderExternalNotFoundOption(w, r, authReq, nil)
|
||||
if errors.IsNotFound(err) {
|
||||
err = nil
|
||||
}
|
||||
l.renderExternalNotFoundOption(w, r, authReq, err)
|
||||
return
|
||||
}
|
||||
l.renderNextStep(w, r, authReq)
|
||||
|
@ -466,7 +466,7 @@ func PasswordCodeSentAggregate(aggCreator *es_models.AggregateCreator, user *mod
|
||||
|
||||
func ExternalLoginCheckSucceededAggregate(aggCreator *es_models.AggregateCreator, user *model.User, check *model.AuthRequest) es_sdk.AggregateFunc {
|
||||
return func(ctx context.Context) (*es_models.Aggregate, error) {
|
||||
agg, err := UserAggregate(ctx, aggCreator, user)
|
||||
agg, err := UserAggregateOverwriteContext(ctx, aggCreator, user, user.ResourceOwner, user.AggregateID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user