chore: 🤖 show login name in header

This commit is contained in:
Randall Morey committed 2020-10-01 14:15:20 -04:00
1 parent 26b1632d4d
commit 816efec6ed
2 files changed
+8 -3

No files matched your search

+7 -2
View File
@@ -93,19 +93,24 @@ export default class PasswordAuthenticator extends BaseAuthenticator {
const authEndpointURL = this.buildAuthEndpointURL(options);
const response = await fetch(authEndpointURL, { method: 'post', body });
const json = await response.json();
return response.status < 400 ? resolve(this.normalizeData(json)) : reject();
return response.status < 400
? resolve(this.normalizeData(json, login_name))
: reject();
}
/**
* Normalizes the auth data. Adds convenience booleans depending on the
* scope within which the session is authenticated: isGlobal, isOrg.
* If a `username` is provided, appends this to the data.
* @param {object} data
* @param {string} username
* @return {object}
*/
normalizeData(data) {
normalizeData(data, username) {
// Add booleans indicated the scope type
data.isGlobal = (data?.scope?.type === 'global');
data.isOrg = (data?.scope?.type === 'org');
if (username) data.username = username;
return data;
}
+1 -1
View File
@@ -34,7 +34,7 @@
<header.utilities as |utilities|>
<utilities.dropdown
@iconOnly={{true}}
@text={{this.session.data.authenticated.username}}
@icon="boundary-icons/user-profile" as |dropdown|
>
{{!-- <dropdown.link @route="account.change-password">