-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Reject duplicate access token name #7135
Conversation
// AccessTokenByNameExists checks if a token name has been used already | ||
// by a user. | ||
func AccessTokenByNameExists(token *AccessToken) bool { | ||
exists, _ := x.Get(token) |
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
x.Table("token").Where("name=?", tokenName).Exist()
is better.
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. |
@adelowo whats the state? |
Yikes. Will try to prepare this for 1.11 |
@adelowo Can I take this too? |
Yes. |
new PR can be found here: #10994 |
Thanks. |
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