mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 13:57:29 -08:00
fix: Fix user redirect to signin bug (#4623)
This commit is contained in:
parent
b4cec38ee8
commit
402b75ac28
|
@ -91,9 +91,9 @@ export default mixins(
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loginWithCookie(): void {
|
async loginWithCookie(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
this.usersStore.loginWithCookie();
|
await this.usersStore.loginWithCookie();
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
async initTemplates(): Promise<void> {
|
async initTemplates(): Promise<void> {
|
||||||
|
|
|
@ -86,15 +86,17 @@ export const useUsersStore = defineStore(STORES.USERS, {
|
||||||
}
|
}
|
||||||
Vue.set(this.currentUser, 'personalizationAnswers', answers);
|
Vue.set(this.currentUser, 'personalizationAnswers', answers);
|
||||||
},
|
},
|
||||||
async getCurrentUser(): void {
|
async getCurrentUser(): Promise<IUserResponse | null> {
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
const user = await getCurrentUser(rootStore.getRestApiContext);
|
const user = await getCurrentUser(rootStore.getRestApiContext);
|
||||||
if (user) {
|
if (user) {
|
||||||
this.addUsers([user]);
|
this.addUsers([user]);
|
||||||
this.currentUserId = user.id;
|
this.currentUserId = user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return user;
|
||||||
},
|
},
|
||||||
async loginWithCookie(): void {
|
async loginWithCookie(): Promise<void> {
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
const user = await loginCurrentUser(rootStore.getRestApiContext);
|
const user = await loginCurrentUser(rootStore.getRestApiContext);
|
||||||
if (user) {
|
if (user) {
|
||||||
|
|
Loading…
Reference in a new issue