mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 13:37:22 +00:00
11 lines
366 B
TypeScript
11 lines
366 B
TypeScript
|
|
import { cookieStorage } from '~/utils/cookie-storage';
|
||
|
|
import { isDefined } from 'twenty-shared/utils';
|
||
|
|
import { AuthTokenPair } from '~/generated/graphql';
|
||
|
|
|
||
|
|
export const getTokenPair = () => {
|
||
|
|
const stringTokenPair = cookieStorage.getItem('tokenPair');
|
||
|
|
return isDefined(stringTokenPair)
|
||
|
|
? (JSON.parse(stringTokenPair) as AuthTokenPair)
|
||
|
|
: undefined;
|
||
|
|
};
|