-
Notifications
You must be signed in to change notification settings - Fork 17
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
Display logged user #57
Conversation
src/helpers/parseJwt.js
Outdated
@@ -0,0 +1,6 @@ | |||
export const parseJwt = token => { | |||
const base64Url = token.split('.')[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a library to parse JWT. Maybe this one https://github.com/auth0/node-jsonwebtoken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, @italolelis
src/modules/Layout/Header/Header.js
Outdated
@@ -7,7 +8,12 @@ import './Header.css'; | |||
|
|||
const b = block('j-header'); | |||
|
|||
const Header = ({ logged }) => { | |||
const propTypes = { | |||
logged: PropTypes.bool.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you already have the user wouldn't that already imply that it is logged in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually yes, @Vxplus , totally agree!
src/modules/Layout/Header/Header.js
Outdated
@@ -18,6 +24,12 @@ const Header = ({ logged }) => { | |||
<Nav /> | |||
</div> | |||
<div className={b('col', { right: true })}> | |||
{ | |||
user && | |||
<span className={b('user')}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe user-name
or display-name
would be more specific for this user sounds like a container imo.
src/modules/Layout/Header/Header.js
Outdated
const Header = ({ logged }) => { | ||
const propTypes = { | ||
logged: PropTypes.bool.isRequired, | ||
user: PropTypes.string.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe username
fits this more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe in future, there will appear some additional info, so I will change user<String>
to user<Object>
and fill it with all necessary info. What do you think, @Vxplus ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me.
No description provided.