Skip to content

Commit

Permalink
fix(web): auth error
Browse files Browse the repository at this point in the history
  • Loading branch information
atty303 committed May 14, 2024
1 parent 2808c86 commit 8e06d0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/web/src/PobWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ export default function PobWindow(props: {
const [_token, setToken] = useState<string>();
useEffect(() => {
async function getToken() {
const t = await auth0.getAccessTokenSilently();
setToken(t);
if (auth0.isAuthenticated) {
const t = await auth0.getAccessTokenSilently();
setToken(t);
}
}
getToken();
}, [auth0]);
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
<Auth0Provider
domain="pob-web.us.auth0.com"
clientId="o8TOT9gDHzztbdIIIV54HxlfaSMFYTeH"
legacySameSiteCookie={false}
useRefreshTokens={true}
authorizationParams={{
redirect_uri: window.location.origin,
audience: "https://pob.cool/api",
scope: "openid profile email offline_access",
}}
>
<App />
Expand Down

0 comments on commit 8e06d0e

Please sign in to comment.