Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { UserUtils } from "@dndbeyond/authentication-lib-js";
|
||||
|
||||
import { getDecodedStt } from "./tokenUtils";
|
||||
|
||||
export const getUserToken = async () => {
|
||||
const stt = await getDecodedStt();
|
||||
return stt;
|
||||
};
|
||||
|
||||
export const getUser = async () => {
|
||||
const token = await getUserToken();
|
||||
return {
|
||||
...UserUtils.jwtToUser(token),
|
||||
displayName: token.displayName,
|
||||
};
|
||||
};
|
||||
|
||||
export const getUserDisplayName = async () => {
|
||||
const user = await getUser();
|
||||
return user.displayName;
|
||||
};
|
||||
|
||||
export const getUserId = async () => {
|
||||
const user = await getUser();
|
||||
return user.id;
|
||||
};
|
||||
|
||||
export const getSubscriptionTier = async () => {
|
||||
const user = await getUser();
|
||||
return user.subscriptionTier;
|
||||
};
|
||||
|
||||
export const getRoles = async () => {
|
||||
const user = await getUser();
|
||||
return user.roles;
|
||||
};
|
||||
Reference in New Issue
Block a user