From f6951d462dda057be5fc7fccefce612af427826f Mon Sep 17 00:00:00 2001 From: larry-internxt Date: Tue, 7 Mar 2023 18:51:33 +0100 Subject: [PATCH] refresh drive-web session tokens after password change --- src/app/auth/services/auth.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/auth/services/auth.service.ts b/src/app/auth/services/auth.service.ts index 8bde6da8d..79453741a 100644 --- a/src/app/auth/services/auth.service.ts +++ b/src/app/auth/services/auth.service.ts @@ -202,7 +202,10 @@ export const changePassword = async (newPassword: string, currentPassword: strin encryptedMnemonic: encryptedMnemonic, encryptedPrivateKey: privateKeyEncrypted, }) - .then(() => { + .then((res) => { + const { token, newToken } = res as any; + if (token) localStorageService.set('xToken', token); + if (newToken) localStorageService.set('xNewToken', newToken); analyticsService.track(email, 'success'); }) .catch((error) => {