mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
bug fix (#5969)
This commit is contained in:
6
website/src/theme/Root.tsx
vendored
6
website/src/theme/Root.tsx
vendored
@@ -54,8 +54,8 @@ export default function Root({ children }) {
|
||||
|
||||
useEffect(() => {
|
||||
if (location.pathname.startsWith("/pro") || location.pathname.startsWith("/excel")) {
|
||||
const cookie = document.cookie.split(";").find((c) => c.trim().startsWith("docs-login="));
|
||||
const payload = decodeURIComponent(cookie.split('=')[1].split('.')[0]);
|
||||
const cookie = document.cookie?.split(";").find((c) => c.trim().startsWith("docs-login="));
|
||||
const payload = decodeURIComponent(cookie?.split('=')[1].split('.')[0]);
|
||||
if (isValidBase64(payload)) {
|
||||
const decodedPayload = atob(decodeURIComponent(payload));
|
||||
// decide what we want to do whether the user is logged in or not
|
||||
@@ -82,4 +82,4 @@ function isValidBase64(str) {
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user