Skip to content

Commit

Permalink
fix: token not being set when navigating after sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
klausborges committed Jan 7, 2025
1 parent 2d5c86a commit 56381c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/console/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,14 @@ const WrappedStoreRoutes = observer(() => {
skip: !store.token,
});
const [readyToRender, setReadyToRender] = useState(false);
const [token] = useState(() => getLocalStorage("token", ""));
const [stateToken] = useState(() => {
return store.token || getLocalStorage("token", "");
});
const navigate = useNavigate();

const validateAuth = async () => {
const token = stateToken || getLocalStorage("token", "");

if (token) {
// has token, but maybe it's expired
store.token = token;
Expand Down

0 comments on commit 56381c5

Please sign in to comment.