Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
BRAVO68WEB wants to merge5 commits intocoder:mainfromBRAVO68WEB:feat/reauth-warn

Conversation

BRAVO68WEB
Copy link
Contributor

@BRAVO68WEBBRAVO68WEB commentedAug 8, 2024
edited
Loading

  • feat: added feature to show warning to user if they are already logged in

@cdr-botcdr-botbot added the communityPull Requests and issues created by the community. labelAug 8, 2024
@BRAVO68WEBBRAVO68WEB changed the titlefeat/reauth warnfeat: added feature to show warning to user if they are already logged inAug 8, 2024
@BRAVO68WEBBRAVO68WEB changed the titlefeat: added feature to show warning to user if they are already logged infeat: add feature to show warning to user if they are already logged inAug 8, 2024
@BRAVO68WEB
Copy link
ContributorAuthor

closes#11004

@BRAVO68WEB
Copy link
ContributorAuthor

image

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, could you fix the issues and also make sure the tests pass?

@BRAVO68WEB
Copy link
ContributorAuthor

@mafredri Can you crosscheck now?

cli/root.go Outdated

// IF r.token and r.clientUR, exists then print warning "You are already logged in to $"
if r.token != "" && r.clientURL.String() != "" {
_, _ = fmt.Fprintf(inv.Stdout, Caret+"%s!\n", pretty.Sprint(cliui.DefaultStyles.Warn, "You are already logged in to "+r.clientURL.String()))
Copy link
Member

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?

matifali reacted with thumbs up emoji
Copy link
Member

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.

Copy link
ContributorAuthor

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?

Copy link
Member

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.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Noted

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelAug 20, 2024
@matifalimatifali removed the staleThis issue is like stale bread. labelAug 22, 2024
@matifali
Copy link
Member

Hi@BRAVO68WEB , thank you for your contributions! Do you still plan to complete this PR? Looking forward to your updates.

@BRAVO68WEB
Copy link
ContributorAuthor

Sorry, was busy busy with work. Pushing my changes......

matifali reacted with thumbs up emoji

@BRAVO68WEB
Copy link
ContributorAuthor

i am not about fetch current logged in user.

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelSep 5, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@matifalimatifalimatifali left review comments

@deansheatherdeansheatherdeansheather left review comments

@coadlercoadlerAwaiting requested review from coadler

@mafredrimafredriAwaiting requested review from mafredri

Assignees

@BRAVO68WEBBRAVO68WEB

Labels
communityPull Requests and issues created by the community.staleThis issue is like stale bread.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@BRAVO68WEB@matifali@mafredri@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp