Refactor Global state into Context Files (#128)

This commit is contained in:
Steve Faulkner
2020-08-06 14:03:46 -05:00
committed by GitHub
parent d45af21996
commit 0011007d5f
71 changed files with 713 additions and 717 deletions

View File

@@ -1,6 +1,6 @@
import AuthHeadersUtil from "../Platform/Hosted/Authorization";
import { decryptJWTToken } from "./AuthorizationUtils";
import { CosmosClient } from "../Common/CosmosClient";
import { userContext } from "../UserContext";
export function getFullName(): string {
let fullName: string;
@@ -8,7 +8,7 @@ export function getFullName(): string {
if (user) {
fullName = user.profile.name;
} else {
const authToken = CosmosClient.authorizationToken();
const authToken = userContext.authorizationToken;
const props = decryptJWTToken(authToken);
fullName = props.name;
}