fix: initial access token after install is now set correctly

This commit is contained in:
Jordan Knott
2020-09-12 03:24:09 -05:00
parent 61cd376bfd
commit e2ef8a1a19
4 changed files with 7 additions and 2 deletions

View File

@ -59,7 +59,7 @@ const Install = () => {
} else {
const response: RefreshTokenResponse = await x.data;
const { accessToken: newToken, isInstalled } = response;
const claims: JWTToken = jwtDecode(accessToken);
const claims: JWTToken = jwtDecode(newToken);
const currentUser = {
id: claims.userId,
roles: {
@ -69,7 +69,7 @@ const Install = () => {
},
};
setUser(currentUser);
setAccessToken(accessToken);
setAccessToken(newToken);
if (!isInstalled) {
history.replace('/install');
}