From 25dae3671afc6d26d72f9be28479d4cdd23d87f4 Mon Sep 17 00:00:00 2001 From: Giovanne Tarcitano Date: Tue, 29 Jun 2021 11:13:08 -0300 Subject: [PATCH] fix: user id on async-storage --- src/auth/index.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/auth/index.tsx b/src/auth/index.tsx index f86df2d..b62bd1c 100644 --- a/src/auth/index.tsx +++ b/src/auth/index.tsx @@ -21,15 +21,12 @@ export function Login({ additionalParameters, }); - console.log(jwtDecode(oAuthResponse.idToken)); + const userId = jwtDecode(oAuthResponse.idToken).sub; Promise.all([ setStorageItem('userApiToken', oAuthResponse.idToken), setStorageItem('userRefreshToken', oAuthResponse.refreshToken), - setStorageItem( - 'userId', - jwtDecode(oAuthResponse.idToken).sub - ), + setStorageItem('userId', userId), ]); }