feat: Profile tab does not depend on isGuest.

Introduced a config property to disable profile.
This commit is contained in:
damencho
2020-11-05 11:35:03 -06:00
committed by Дамян Минков
parent c14f639639
commit 9fa29d7353
7 changed files with 16 additions and 15 deletions

View File

@@ -1,7 +1,5 @@
/* @flow */
import jwtDecode from 'jwt-decode';
import { parseURLParams } from '../util';
/**
@@ -24,7 +22,7 @@ export function parseJWTFromURLParams(url: URL = window.location) {
* @returns {string}
*/
export function getJwtName(state: Object) {
const jwtData = jwtDecode(state['features/base/jwt'].jwt);
const { user } = state['features/base/jwt'];
return jwtData?.context?.user?.name || '';
return user?.name || '';
}