From 1c8037f291188dc4dbe14e85c72a2bc300b6c376 Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Fri, 16 Jun 2023 10:27:43 +0200 Subject: [PATCH] fix: external user check (#6038) --- internal/api/ui/login/external_provider_handler.go | 2 +- internal/domain/auth_request.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/ui/login/external_provider_handler.go b/internal/api/ui/login/external_provider_handler.go index abd07a70ec..d54d29b4ed 100644 --- a/internal/api/ui/login/external_provider_handler.go +++ b/internal/api/ui/login/external_provider_handler.go @@ -288,7 +288,7 @@ func (l *Login) handleExternalUserAuthenticated( externalUser := mapIDPUserToExternalUser(user, provider.ID) // check and fill in local linked user externalErr := l.authRepo.CheckExternalUserLogin(setContext(r.Context(), ""), authReq.ID, authReq.AgentID, externalUser, domain.BrowserInfoFromRequest(r)) - if !errors.IsNotFound(externalErr) { + if externalErr != nil && !errors.IsNotFound(externalErr) { l.renderError(w, r, authReq, externalErr) return } diff --git a/internal/domain/auth_request.go b/internal/domain/auth_request.go index 86cd0575f6..c0b9e1a40a 100644 --- a/internal/domain/auth_request.go +++ b/internal/domain/auth_request.go @@ -42,7 +42,7 @@ type AuthRequest struct { PrivateLabelingSetting PrivateLabelingSetting SelectedIDPConfigID string LinkingUsers []*ExternalUser - PossibleSteps []NextStep + PossibleSteps []NextStep `json:"-"` PasswordVerified bool MFAsVerified []MFAType Audience []string