-
Notifications
You must be signed in to change notification settings - Fork 881
feat: add feature to show warning to user if they are already logged in #14219
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d0e3ba4
Merge pull request #2 from coder/main
BRAVO68WEB 8050075
Merge branch 'coder:main' into main
BRAVO68WEB e1e6495
feat: added feature to show warning to user if they are already logge…
BRAVO68WEB f9270a9
fix: added requested changes
BRAVO68WEB ac95006
chore: minor changes
BRAVO68WEB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: added requested changes
- Loading branch information
commit f9270a9b8c0da09098a9ab11f47151ef9fbae01b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm thinking about what we want to achieve with this warning. As it stands I imagine it will be slightly annoying to see the warning but not be able to do an action based on it.
Also, the token could be expired so then we're kind of lying to the user as they're not really logged in.
Should we move this from middleware and prompt the user for what to do instead (+ verify token is valid)? WDYT @matifali?
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 I agree 💯. Checking token for validity should be a must and if expired should instruct the user to relogin.
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.
Guys, give me a final rundown about what should I implement?
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.
I think for merge this should call the coder API to see what the current user is and print the username as well. If the request fails, any message should be suppressed.
This should also print to stderr rather than stdout.
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.
Noted