Skip to content

Reject duplicate access token name #7135

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

Conversation

adelowo
Copy link
Member

@adelowo adelowo commented Jun 5, 2019

I have run into cases where I have multiple tokens with the same name and
it becomes hard to find out which one is no longer being used, so it can be deleted

// AccessTokenByNameExists checks if a token name has been used already
// by a user.
func AccessTokenByNameExists(token *AccessToken) bool {
exists, _ := x.Get(token)
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

x.Table("token").Where("name=?", tokenName).Exist()

is better.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 6, 2019
@stale
Copy link

stale bot commented Aug 5, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Aug 5, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Aug 5, 2019
@stale stale bot removed the issue/stale label Aug 5, 2019
@6543
Copy link
Member

6543 commented Oct 29, 2019

@adelowo whats the state?

@adelowo
Copy link
Member Author

adelowo commented Oct 30, 2019

Yikes. Will try to prepare this for 1.11

@6543
Copy link
Member

6543 commented Apr 6, 2020

@adelowo Can I take this too?

@adelowo
Copy link
Member Author

adelowo commented Apr 6, 2020

Yes.

@6543
Copy link
Member

6543 commented Apr 6, 2020

new PR can be found here: #10994

@6543
Copy link
Member

6543 commented Apr 13, 2020

@adelowo merged as: ad5c43a 🎉

@adelowo
Copy link
Member Author

adelowo commented Apr 13, 2020

Thanks.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants