LocChat/client/utils/parse_jwt.js
Joseph Ditton 84b45cd6b1 adds roles
2021-12-01 20:18:26 -07:00

6 lines
153 B
JavaScript

export const parseJwt = (token) => {
if (!token) return {};
const jwtPayload = JSON.parse(window.atob(token.split('.')[1]));
return jwtPayload;
};