diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index d11702535d086..626e2624528ff 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -91,9 +91,9 @@ export default mixins( throw e; } }, - loginWithCookie(): void { + async loginWithCookie(): Promise { try { - this.usersStore.loginWithCookie(); + await this.usersStore.loginWithCookie(); } catch (e) {} }, async initTemplates(): Promise { diff --git a/packages/editor-ui/src/stores/users.ts b/packages/editor-ui/src/stores/users.ts index 514d2c919f36f..dd78fe178200a 100644 --- a/packages/editor-ui/src/stores/users.ts +++ b/packages/editor-ui/src/stores/users.ts @@ -86,15 +86,17 @@ export const useUsersStore = defineStore(STORES.USERS, { } Vue.set(this.currentUser, 'personalizationAnswers', answers); }, - async getCurrentUser(): void { + async getCurrentUser(): Promise { 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 { const rootStore = useRootStore(); const user = await loginCurrentUser(rootStore.getRestApiContext); if (user) {