Skip to content

Commit

Permalink
fix token refresh not working
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAman62 committed Aug 31, 2024
1 parent 534452a commit 7f82509
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/src/UserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function UserContextProvider({ children }: React.PropsWithChildre
AuthFlow: "REFRESH_TOKEN_AUTH",
ClientId: "6q9id5vhqfocb9mc0deep4at49",
AuthParameters: {
REFRESH_TOKEN: user?.refreshToken,
REFRESH_TOKEN: user.refreshToken,
},
};

Expand All @@ -59,9 +59,9 @@ export default function UserContextProvider({ children }: React.PropsWithChildre

const json = await res.json();
if (json) {
setUser({ username: user.username, id: user.id, refreshToken: json.RefreshToken, idToken: json.IdToken });
setUser({ username: user.username, id: user.id, refreshToken: json?.AuthenticationResult?.RefreshToken, idToken: json?.AuthenticationResult?.IdToken });
}
return json.IdToken as string;
return json?.AuthenticationResult?.IdToken as string;
};

const onClose = () => {
Expand Down

0 comments on commit 7f82509

Please sign in to comment.