mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +00:00
Notebooks Gallery (#59)
* Initial commit * Address PR comments * Move notebook related stuff to NotebookManager and dynamically load it * Add New gallery callout and other UI tweaks * Update test snapshot
This commit is contained in:
17
src/Utils/UserUtils.ts
Normal file
17
src/Utils/UserUtils.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import AuthHeadersUtil from "../Platform/Hosted/Authorization";
|
||||
import { decryptJWTToken } from "./AuthorizationUtils";
|
||||
import { CosmosClient } from "../Common/CosmosClient";
|
||||
|
||||
export function getFullName(): string {
|
||||
let fullName: string;
|
||||
const user = AuthHeadersUtil.getCachedUser();
|
||||
if (user) {
|
||||
fullName = user.profile.name;
|
||||
} else {
|
||||
const authToken = CosmosClient.authorizationToken();
|
||||
const props = decryptJWTToken(authToken);
|
||||
fullName = props.name;
|
||||
}
|
||||
|
||||
return fullName;
|
||||
}
|
||||
Reference in New Issue
Block a user