UNPKG

panjareh

Version:

Panjareh using aparat and phoenix-video-player to play videos on desktops and tvs.

15 lines (13 loc) 413 B
import { AuthStorage, parseJwt, getUniqueUserId } from "../utils"; function getUser() { const token = AuthStorage.getToken(); let uuid = AuthStorage.getUUID(); if (uuid === null) { uuid = getUniqueUserId(); AuthStorage.setUUID(uuid); } if (!token) return { userInfo: null, token: null, uuid: uuid }; const userInfo = parseJwt(token); return { userInfo, token, uuid }; } export { getUser };