From 8761f71bdac52f954628f98af132df8bd60ecb73 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 15 Nov 2024 15:50:27 +0100 Subject: [PATCH] ui: update jwt with new pass --- frontend/app/mstore/userStore.ts | 5 ++++- frontend/app/services/UserService.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/app/mstore/userStore.ts b/frontend/app/mstore/userStore.ts index d6499b857..e8c40a1ab 100644 --- a/frontend/app/mstore/userStore.ts +++ b/frontend/app/mstore/userStore.ts @@ -421,8 +421,11 @@ class UserStore { this.updatePasswordRequest = { loading: true, errors: [] }; }); try { - await userService.updatePassword(params); + const data = await userService.updatePassword(params) as { jwt: string, spotJwt: string, data: any }; runInAction(() => { + this.jwt = data.jwt; + this.spotJwt = data.spotJwt; + this.scopeState = data.data.scopeState; this.updatePasswordRequest = { loading: false, errors: [] }; }); return; diff --git a/frontend/app/services/UserService.ts b/frontend/app/services/UserService.ts index 1689fd4dd..849dbbfbb 100644 --- a/frontend/app/services/UserService.ts +++ b/frontend/app/services/UserService.ts @@ -161,7 +161,7 @@ export default class UserService { return this.client .post('/account/password', data) .then((response: { json: () => any }) => response.json()) - .then((response: { data: any }) => response.data || {}); + .then((response: { data: any }) => response || {}); } fetchTenants() {