mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-29 12:21:57 +08:00
23 lines
569 B
TypeScript
23 lines
569 B
TypeScript
import getLocalStorageKey from 'api/browser/localstorage/get';
|
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
|
import { User } from 'types/reducer/app';
|
|
|
|
export const getInitialUserTokenRefreshToken = (): AuthTokenProps | null => {
|
|
const accessJwt = getLocalStorageKey(LOCALSTORAGE.AUTH_TOKEN);
|
|
const refreshJwt = getLocalStorageKey(LOCALSTORAGE.REFRESH_AUTH_TOKEN);
|
|
|
|
if (accessJwt && refreshJwt) {
|
|
return {
|
|
accessJwt,
|
|
refreshJwt,
|
|
};
|
|
}
|
|
|
|
return null;
|
|
};
|
|
|
|
interface AuthTokenProps {
|
|
accessJwt: User['accessJwt'];
|
|
refreshJwt: User['refreshJwt'];
|
|
}
|