mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -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;
|
||||
}
|
||||
},
|
||||
loginWithCookie(): void {
|
||||
async loginWithCookie(): Promise<void> {
|
||||
try {
|
||||
this.usersStore.loginWithCookie();
|
||||
await this.usersStore.loginWithCookie();
|
||||
} catch (e) {}
|
||||
},
|
||||
async initTemplates(): Promise<void> {
|
||||
|
|
|
@ -86,15 +86,17 @@ export const useUsersStore = defineStore(STORES.USERS, {
|
|||
}
|
||||
Vue.set(this.currentUser, 'personalizationAnswers', answers);
|
||||
},
|
||||
async getCurrentUser(): void {
|
||||
async getCurrentUser(): Promise<IUserResponse | null> {
|
||||
const rootStore = useRootStore();
|
||||
const user = await getCurrentUser(rootStore.getRestApiContext);
|
||||
if (user) {
|
||||
this.addUsers([user]);
|
||||
this.currentUserId = user.id;
|
||||
}
|
||||
|
||||
return user;
|
||||
},
|
||||
async loginWithCookie(): void {
|
||||
async loginWithCookie(): Promise<void> {
|
||||
const rootStore = useRootStore();
|
||||
const user = await loginCurrentUser(rootStore.getRestApiContext);
|
||||
if (user) {
|
||||
|
|
Loading…
Reference in a new issue