-
Notifications
You must be signed in to change notification settings - Fork 0
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
Simple test login implementation #6
base: master
Are you sure you want to change the base?
Conversation
6c1b9c9
to
eb1ecae
Compare
eb1ecae
to
c125ec9
Compare
Plz setup Prettier to use single quotes |
c125ec9
to
f1654c8
Compare
@michalsanger done |
localStorage.setItem('token', response.login.token); | ||
} | ||
if (window) { | ||
window.location.reload(); |
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.
Not happy with this hack. Relay should take care of passing new props to components so re-render should happen. Isn't is a sign of bad implementation fi we need this?
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.
yes sure, it is a hack. had no idea how to make it re-render (I mentioned it in the first comment here)
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.
as I understood from our short offline conversation at the beginning of sprint planning, you already tried to fix it?
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 not, then I will try to update store with updater and trigger re-rendering from the changes
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.
Check it here 3bf63a7
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.
looks nice. pulled from that branch and committed it here
after login mutation server response the token is stored in localStorage and then sent in Authorization header on each request. the currentUser query in Login.js is called on first render but after mutation there is no auto re-render so for now I used window.location.reload() in the mutation callback (right after storing the token)
meanwhile will try to figure out why the re-render is not triggered