Skip to content

Commit

Permalink
SSO/SAML : add Base URL to redirects in acsHandler (#5923)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jimw383 and flipswitchingmonkey authored Apr 24, 2023
1 parent 57aab63 commit 03be725
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cli/src/sso/saml/routes/saml.controller.ee.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 03be725

Please sign in to comment.