From 7ef414cc33ab81a5b7499328c7e78133eb9ecb3a Mon Sep 17 00:00:00 2001 From: Logan Saso Date: Wed, 22 Jan 2025 17:09:58 -0800 Subject: [PATCH 1/2] fix bad error message --- pkg/connector/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/connector/user.go b/pkg/connector/user.go index 0e32ed9f..83bdf15f 100644 --- a/pkg/connector/user.go +++ b/pkg/connector/user.go @@ -373,7 +373,7 @@ func getUserProfile(accountInfo *v2.AccountInfo) (*okta.UserProfile, error) { email, ok := pMap["email"] if !ok { - return nil, fmt.Errorf("okta-connectorv2: missing last name in account info") + return nil, fmt.Errorf("okta-connectorv2: missing email in account info") } login, ok := pMap["login"] if !ok { From e82ebb71d37b9d29acb17d92e9ef783f3ca24564 Mon Sep 17 00:00:00 2001 From: Logan Saso Date: Wed, 22 Jan 2025 17:14:23 -0800 Subject: [PATCH 2/2] Code formatting while I'm here --- pkg/connector/user.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/connector/user.go b/pkg/connector/user.go index 83bdf15f..2f7c9089 100644 --- a/pkg/connector/user.go +++ b/pkg/connector/user.go @@ -359,6 +359,7 @@ func getCredentialOption(credentialOptions *v2.CredentialOptions) (*okta.UserCre }, }, nil } + func getUserProfile(accountInfo *v2.AccountInfo) (*okta.UserProfile, error) { pMap := accountInfo.Profile.AsMap() firstName, ok := pMap["first_name"] @@ -375,10 +376,12 @@ func getUserProfile(accountInfo *v2.AccountInfo) (*okta.UserProfile, error) { if !ok { return nil, fmt.Errorf("okta-connectorv2: missing email in account info") } + login, ok := pMap["login"] if !ok { login = email } + return &okta.UserProfile{ "firstName": firstName, "lastName": lastName,