fix(core): Improve SAML connection test result views (#5981)

* improve test result views

* refactor

* lint fix
This commit is contained in:
Michael Auerswald
2023-04-14 15:49:10 +02:00
committed by GitHub
parent 18d5156994
commit 4c994faec1
5 changed files with 109 additions and 16 deletions

View File

@@ -139,14 +139,11 @@ export class SamlService {
async handleSamlLogin(
req: express.Request,
binding: SamlLoginBinding,
): Promise<
| {
authenticatedUser: User | undefined;
attributes: SamlUserAttributes;
onboardingRequired: boolean;
}
| undefined
> {
): Promise<{
authenticatedUser: User | undefined;
attributes: SamlUserAttributes;
onboardingRequired: boolean;
}> {
const attributes = await this.getAttributesFromLoginResponse(req, binding);
if (attributes.email) {
const user = await Db.collections.User.findOne({
@@ -187,7 +184,11 @@ export class SamlService {
}
}
}
return undefined;
return {
authenticatedUser: undefined,
attributes,
onboardingRequired: false,
};
}
async setSamlPreferences(prefs: SamlPreferences): Promise<SamlPreferences | undefined> {