SSO/SAML : add Base URL to redirects in acsHandler (#5923)
add Base URL to redirects in acsHandler I modified the redirections to include the base URL of the instance so that the redirects remain correct even if the instance is accessed from a subdirectory. Co-authored-by: Michael Auerswald <michael.auerswald@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import express from 'express';
|
||||
import { getInstanceBaseUrl } from '@/UserManagement/UserManagementHelper';
|
||||
import { Authorized, Get, Post, RestController } from '@/decorators';
|
||||
import { SamlUrls } from '../constants';
|
||||
import {
|
||||
@@ -125,9 +126,9 @@ export class SamlController {
|
||||
if (isSamlLicensedAndEnabled()) {
|
||||
await issueCookie(res, loginResult.authenticatedUser);
|
||||
if (loginResult.onboardingRequired) {
|
||||
return res.redirect(SamlUrls.samlOnboarding);
|
||||
return res.redirect(getInstanceBaseUrl() + SamlUrls.samlOnboarding);
|
||||
} else {
|
||||
return res.redirect(SamlUrls.defaultRedirect);
|
||||
return res.redirect(getInstanceBaseUrl() + SamlUrls.defaultRedirect);
|
||||
}
|
||||
} else {
|
||||
return res.status(202).send(loginResult.attributes);
|
||||
|
||||
Reference in New Issue
Block a user