diff --git a/packages/cli/src/sso/saml/routes/saml.controller.ee.ts b/packages/cli/src/sso/saml/routes/saml.controller.ee.ts index 731d67f375..1dfe6ded82 100644 --- a/packages/cli/src/sso/saml/routes/saml.controller.ee.ts +++ b/packages/cli/src/sso/saml/routes/saml.controller.ee.ts @@ -104,7 +104,7 @@ export class SamlController { private async acsHandler(req: express.Request, res: express.Response, binding: SamlLoginBinding) { const loginResult = await this.samlService.handleSamlLogin(req, binding); if (loginResult) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + // return attributes if this is a test connection if (req.body.RelayState && req.body.RelayState === getServiceProviderConfigTestReturnUrl()) { return res.status(202).send(loginResult.attributes); } diff --git a/packages/cli/src/sso/saml/saml.service.ee.ts b/packages/cli/src/sso/saml/saml.service.ee.ts index 7607a71ee3..22909f46c9 100644 --- a/packages/cli/src/sso/saml/saml.service.ee.ts +++ b/packages/cli/src/sso/saml/saml.service.ee.ts @@ -154,7 +154,7 @@ export class SamlService { relations: ['globalRole', 'authIdentities'], }); if (user) { - // Login path for existing users that are fully set up + // Login path for existing users that are fully set up and that have a SAML authIdentity set up if ( user.authIdentities.find( (e) => e.providerType === 'saml' && e.providerId === attributes.userPrincipalName, @@ -168,10 +168,11 @@ export class SamlService { } else { // Login path for existing users that are NOT fully set up for SAML const updatedUser = await updateUserFromSamlAttributes(user, attributes); + const onboardingRequired = !updatedUser.firstName || !updatedUser.lastName; return { authenticatedUser: updatedUser, attributes, - onboardingRequired: true, + onboardingRequired, }; } } else {