mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -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,
|
||||
});
|
||||
|
||||
const userData = computed(() => usersStore.currentUser);
|
||||
|
||||
return {
|
||||
isLoading,
|
||||
setLoading,
|
||||
|
@ -80,5 +82,6 @@ export const useSSOStore = defineStore('sso', () => {
|
|||
saveSamlConfig,
|
||||
testSamlConfig,
|
||||
updateUser,
|
||||
userData,
|
||||
};
|
||||
});
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router/composables';
|
||||
import { Notification } from 'element-ui';
|
||||
import { IFormBoxConfig } from 'n8n-design-system';
|
||||
import AuthView from '@/views/AuthView.vue';
|
||||
import { i18n as locale } from '@/plugins/i18n';
|
||||
import { useSSOStore } from '@/stores/sso';
|
||||
import { VIEWS } from '@/constants';
|
||||
|
||||
const router = useRouter();
|
||||
const ssoStore = useSSOStore();
|
||||
|
||||
const loading = ref(false);
|
||||
|
@ -14,6 +18,7 @@ const FORM_CONFIG: IFormBoxConfig = reactive({
|
|||
inputs: [
|
||||
{
|
||||
name: 'firstName',
|
||||
initialValue: ssoStore.userData?.firstName,
|
||||
properties: {
|
||||
label: locale.baseText('auth.firstName'),
|
||||
maxlength: 32,
|
||||
|
@ -24,6 +29,7 @@ const FORM_CONFIG: IFormBoxConfig = reactive({
|
|||
},
|
||||
{
|
||||
name: 'lastName',
|
||||
initialValue: ssoStore.userData?.lastName,
|
||||
properties: {
|
||||
label: locale.baseText('auth.lastName'),
|
||||
maxlength: 32,
|
||||
|
@ -34,8 +40,19 @@ const FORM_CONFIG: IFormBoxConfig = reactive({
|
|||
},
|
||||
],
|
||||
});
|
||||
const onSubmit = (values: { firstName: string; lastName: string }) => {
|
||||
ssoStore.updateUser(values);
|
||||
const onSubmit = async (values: { firstName: string; lastName: string }) => {
|
||||
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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue