Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add Name to auth.Account as a user friendly alias #1992

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

Merged
merged 4 commits into from
Sep 10, 2020
Merged

Conversation

domwong
Copy link
Contributor

@domwong domwong commented Sep 10, 2020

Means that we can have ID as a UUID that never changes for the account and Name can be used as a user friendly alias which you could change. e.g. User would like to change their email or username.

@@ -54,13 +54,17 @@ func (j *jwtAuth) Generate(id string, opts ...auth.GenerateOption) (*auth.Accoun
if len(options.Issuer) == 0 {
options.Issuer = j.Options().Issuer
}

name := options.Name
if name == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Across the rest of the codebase, this is normally written as len(name) == 0

@domwong domwong merged commit 601b223 into master Sep 10, 2020
@domwong domwong deleted the feature/account-name branch September 10, 2020 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants