mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Redirect to home page after saving data on SAML onboarding page (no-changelog) (#5961)
fix(editor): redirect to home page after saving data on SAML onboarding page
This commit is contained in:
parent
303521a0e2
commit
02ab1e7eef
|
@ -68,6 +68,8 @@ export const useSSOStore = defineStore('sso', () => {
|
||||||
...params,
|
...params,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const userData = computed(() => usersStore.currentUser);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLoading,
|
isLoading,
|
||||||
setLoading,
|
setLoading,
|
||||||
|
@ -80,5 +82,6 @@ export const useSSOStore = defineStore('sso', () => {
|
||||||
saveSamlConfig,
|
saveSamlConfig,
|
||||||
testSamlConfig,
|
testSamlConfig,
|
||||||
updateUser,
|
updateUser,
|
||||||
|
userData,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router/composables';
|
||||||
|
import { Notification } from 'element-ui';
|
||||||
import { IFormBoxConfig } from 'n8n-design-system';
|
import { IFormBoxConfig } from 'n8n-design-system';
|
||||||
import AuthView from '@/views/AuthView.vue';
|
import AuthView from '@/views/AuthView.vue';
|
||||||
import { i18n as locale } from '@/plugins/i18n';
|
import { i18n as locale } from '@/plugins/i18n';
|
||||||
import { useSSOStore } from '@/stores/sso';
|
import { useSSOStore } from '@/stores/sso';
|
||||||
|
import { VIEWS } from '@/constants';
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
const ssoStore = useSSOStore();
|
const ssoStore = useSSOStore();
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
@ -14,6 +18,7 @@ const FORM_CONFIG: IFormBoxConfig = reactive({
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
name: 'firstName',
|
name: 'firstName',
|
||||||
|
initialValue: ssoStore.userData?.firstName,
|
||||||
properties: {
|
properties: {
|
||||||
label: locale.baseText('auth.firstName'),
|
label: locale.baseText('auth.firstName'),
|
||||||
maxlength: 32,
|
maxlength: 32,
|
||||||
|
@ -24,6 +29,7 @@ const FORM_CONFIG: IFormBoxConfig = reactive({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'lastName',
|
name: 'lastName',
|
||||||
|
initialValue: ssoStore.userData?.lastName,
|
||||||
properties: {
|
properties: {
|
||||||
label: locale.baseText('auth.lastName'),
|
label: locale.baseText('auth.lastName'),
|
||||||
maxlength: 32,
|
maxlength: 32,
|
||||||
|
@ -34,8 +40,19 @@ const FORM_CONFIG: IFormBoxConfig = reactive({
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
const onSubmit = (values: { firstName: string; lastName: string }) => {
|
const onSubmit = async (values: { firstName: string; lastName: string }) => {
|
||||||
ssoStore.updateUser(values);
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
await ssoStore.updateUser(values);
|
||||||
|
await router.push({ name: VIEWS.HOMEPAGE });
|
||||||
|
} catch (error) {
|
||||||
|
loading.value = false;
|
||||||
|
Notification.error({
|
||||||
|
title: 'Error',
|
||||||
|
message: error.message,
|
||||||
|
position: 'bottom-right',
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue