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

Handle invalid tokens on login #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bhawesh96
Copy link
Member

When the token is invalid, sign-out the user and show login-modal again.
Fixes #72

@jayvdb
Copy link
Member

jayvdb commented Oct 31, 2018

@gitmate-bot rebase

@gitmate-bot
Copy link

Hey! I'm GitMate.io! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost permanently ⚠️

@gitmate-bot
Copy link

Automated rebase with GitMate.io was successful! 🎉

@jayvdb
Copy link
Member

jayvdb commented Oct 31, 2018

@bhawesh96 , I have done a rebase using the bot; can you do a squash ?

@bhawesh96
Copy link
Member Author

On it.

@bhawesh96
Copy link
Member Author

bhawesh96 commented Oct 31, 2018

I guess I messed up while squashing. I didn't really get what's happening here while rebasing and/or squashing :/

I just wanna keep this commit (cd1b558) in the PR

Copy link
Member

@li-boxuan li-boxuan left a comment

Choose a reason for hiding this comment

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

Hmmm, you need to learn git a bit more...

On your local machine, drop those unrelated commits. Then do a rebase.

One quick way to fix: reset to the latest commit that in sync with master. Then add your changes again and commit.

@gitmate-bot
Copy link

Automated rebase with GitMate.io was successful! 🎉

@bhawesh96
Copy link
Member Author

@li-boxuan I guess the PR is good to be reviewed now!

Copy link
Member

@jayvdb jayvdb left a comment

Choose a reason for hiding this comment

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

Update your commit message to follow https://coala.io/commit

@bhawesh96
Copy link
Member Author

@gitmate-bot rebase

@gitmate-bot
Copy link

Hey! I'm GitMate.io! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost permanently ⚠️

@gitmate-bot
Copy link

Automated rebase with GitMate.io was successful! 🎉

@@ -63,7 +63,9 @@ class AppNav extends Component {
// }
this.setState({info});
}).catch(() => {
this.setState({info: null});
alert("Invalid user token");
Copy link
Member

Choose a reason for hiding this comment

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

Invalid user token -> GitHub token is invalid.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll change the message. Though I wasn't sure if the way I have handled this issue is a good user experience or not.

Copy link
Member

Choose a reason for hiding this comment

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

It works but is not ideal. Instead of an alert, I would be happier to see an error message displayed on the modal. Besides, the modal shouldn't be closed and then reopened.

Signout the user and show the login-modal if the token is invalid

Closes coala#72
Copy link
Member

@li-boxuan li-boxuan left a comment

Choose a reason for hiding this comment

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

This is more like a trick. It works but does not bring good user experience.

Instead of an alert, I would be happier to see an error message displayed on the modal. Besides, the modal shouldn't be closed and then reopened. (copied from #177 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants