mirror of
https://github.com/p-stream/providers.git
synced 2026-01-11 20:10:33 +00:00
get feb token from auth
This commit is contained in:
parent
b16f20012b
commit
c8cffb6111
2 changed files with 7 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ const getRegion = (): string | null => {
|
|||
const parsed = JSON.parse(regionData);
|
||||
return parsed?.state?.region ?? null;
|
||||
} catch (e) {
|
||||
console.warn('Unable to access or parse region from localStorage:', e);
|
||||
console.warn('Unable to access localStorage or parse auth data:', e);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,9 +4,13 @@ import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
|||
|
||||
const getUserToken = (): string | null => {
|
||||
try {
|
||||
return typeof window !== 'undefined' ? window.localStorage.getItem('febbox_ui_token') : null;
|
||||
if (typeof window === 'undefined') return null;
|
||||
const authData = window.localStorage.getItem('__MW::auth');
|
||||
if (!authData) return null;
|
||||
const parsedAuth = JSON.parse(authData);
|
||||
return parsedAuth?.state?.febboxToken || null;
|
||||
} catch (e) {
|
||||
console.warn('Unable to access localStorage:', e);
|
||||
console.warn('Unable to access localStorage or parse auth data:', e);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue