mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Use redirect url also with SSO login (#14893)
This commit is contained in:
@@ -2,8 +2,8 @@ import type { SamlPreferences, SamlToggleDto } from '@n8n/api-types';
|
||||
import { makeRestApiRequest } from '@/utils/apiUtils';
|
||||
import type { IRestApiContext, SamlPreferencesExtractedData } from '@/Interface';
|
||||
|
||||
export const initSSO = async (context: IRestApiContext): Promise<string> => {
|
||||
return await makeRestApiRequest(context, 'GET', '/sso/saml/initsso');
|
||||
export const initSSO = async (context: IRestApiContext, redirectUrl = ''): Promise<string> => {
|
||||
return await makeRestApiRequest(context, 'GET', `/sso/saml/initsso?redirect=${redirectUrl}`);
|
||||
};
|
||||
|
||||
export const getSamlMetadata = async (context: IRestApiContext): Promise<SamlPreferences> => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { SamlPreferences } from '@n8n/api-types';
|
||||
import { computed, reactive } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { defineStore } from 'pinia';
|
||||
import { EnterpriseEditionFeature } from '@/constants';
|
||||
import { useRootStore } from '@/stores/root.store';
|
||||
@@ -13,6 +14,7 @@ export const useSSOStore = defineStore('sso', () => {
|
||||
const rootStore = useRootStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const usersStore = useUsersStore();
|
||||
const route = useRoute();
|
||||
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
@@ -54,7 +56,11 @@ export const useSSOStore = defineStore('sso', () => {
|
||||
isDefaultAuthenticationSaml.value,
|
||||
);
|
||||
|
||||
const getSSORedirectUrl = async () => await ssoApi.initSSO(rootStore.restApiContext);
|
||||
const getSSORedirectUrl = async () =>
|
||||
await ssoApi.initSSO(
|
||||
rootStore.restApiContext,
|
||||
typeof route.query?.redirect === 'string' ? route.query.redirect : '',
|
||||
);
|
||||
|
||||
const toggleLoginEnabled = async (enabled: boolean) =>
|
||||
await ssoApi.toggleSamlConfig(rootStore.restApiContext, { loginEnabled: enabled });
|
||||
|
||||
Reference in New Issue
Block a user