Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user name and avatar on the top bar #5180

Merged
merged 2 commits into from
Aug 24, 2020
Merged

Add user name and avatar on the top bar #5180

merged 2 commits into from
Aug 24, 2020

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Aug 23, 2020

identity

Requires a new method in the authProvider:

// in src/authProvider.js
const authProvider = {
    login: ({ username, password }) => { /* ... */ },
    getIdentity: () => {
        const { id, fullName, avatar } = JSON.parse(localStorage.getItem('auth'));
        return { id, fullName, avatar };
    }
    // ...
};

export default authProvider;

The change is backward compatible (if the authProvider.getIdentity() method isn't implemented, the admin shows an anonymous user avatar with no name, as before).

@fzaninotto fzaninotto added the RFR Ready For Review label Aug 23, 2020
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants