move sso templates into a folder

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-10-22 13:22:43 +02:00
parent 22440937bf
commit 85958e0967
No known key found for this signature in database
4 changed files with 9 additions and 6 deletions

View file

@ -44,7 +44,7 @@ describe('Test views', () => {
await controller.acsPost(req, res); await controller.acsPost(req, res);
expect(res.render).toBeCalledWith('saml-connection-test-success', attributes); expect(res.render).toBeCalledWith('sso/saml-connection-test-success', attributes);
}); });
test('Should render failure with template', async () => { test('Should render failure with template', async () => {
@ -60,7 +60,10 @@ describe('Test views', () => {
await controller.acsPost(req, res); await controller.acsPost(req, res);
expect(res.render).toBeCalledWith('saml-connection-test-failed', { message: '', attributes }); expect(res.render).toBeCalledWith('sso/saml-connection-test-failed', {
message: '',
attributes,
});
}); });
test('Should render error with template', async () => { test('Should render error with template', async () => {
@ -72,6 +75,6 @@ describe('Test views', () => {
await controller.acsPost(req, res); await controller.acsPost(req, res);
expect(res.render).toBeCalledWith('saml-connection-test-failed', { message: 'Test Error' }); expect(res.render).toBeCalledWith('sso/saml-connection-test-failed', { message: 'Test Error' });
}); });
}); });

View file

@ -119,9 +119,9 @@ export class SamlController {
// if RelayState is set to the test connection Url, this is a test connection // if RelayState is set to the test connection Url, this is a test connection
if (isConnectionTestRequest(req)) { if (isConnectionTestRequest(req)) {
if (loginResult.authenticatedUser) { if (loginResult.authenticatedUser) {
return res.render('saml-connection-test-success', loginResult.attributes); return res.render('sso/saml-connection-test-success', loginResult.attributes);
} else { } else {
return res.render('saml-connection-test-failed', { return res.render('sso/saml-connection-test-failed', {
message: '', message: '',
attributes: loginResult.attributes, attributes: loginResult.attributes,
}); });
@ -154,7 +154,7 @@ export class SamlController {
return sendErrorResponse(res, new AuthError('SAML Authentication failed')); return sendErrorResponse(res, new AuthError('SAML Authentication failed'));
} catch (error) { } catch (error) {
if (isConnectionTestRequest(req)) { if (isConnectionTestRequest(req)) {
return res.render('saml-connection-test-failed', { message: (error as Error).message }); return res.render('sso/saml-connection-test-failed', { message: (error as Error).message });
} }
this.eventService.emit('user-login-failed', { this.eventService.emit('user-login-failed', {
userEmail: 'unknown', userEmail: 'unknown',