mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
fix: Fix user redirect to signin bug (#4623)
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user