mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
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:
parent
57aab63c10
commit
03be725cef
|
@ -1,4 +1,5 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
import { getInstanceBaseUrl } from '@/UserManagement/UserManagementHelper';
|
||||||
import { Authorized, Get, Post, RestController } from '@/decorators';
|
import { Authorized, Get, Post, RestController } from '@/decorators';
|
||||||
import { SamlUrls } from '../constants';
|
import { SamlUrls } from '../constants';
|
||||||
import {
|
import {
|
||||||
|
@ -125,9 +126,9 @@ export class SamlController {
|
||||||
if (isSamlLicensedAndEnabled()) {
|
if (isSamlLicensedAndEnabled()) {
|
||||||
await issueCookie(res, loginResult.authenticatedUser);
|
await issueCookie(res, loginResult.authenticatedUser);
|
||||||
if (loginResult.onboardingRequired) {
|
if (loginResult.onboardingRequired) {
|
||||||
return res.redirect(SamlUrls.samlOnboarding);
|
return res.redirect(getInstanceBaseUrl() + SamlUrls.samlOnboarding);
|
||||||
} else {
|
} else {
|
||||||
return res.redirect(SamlUrls.defaultRedirect);
|
return res.redirect(getInstanceBaseUrl() + SamlUrls.defaultRedirect);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return res.status(202).send(loginResult.attributes);
|
return res.status(202).send(loginResult.attributes);
|
||||||
|
|
Loading…
Reference in a new issue