Skip to content
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

Fix a panic when confirm email with no public name #4210

Merged
merged 1 commit into from
Nov 9, 2023
Merged

Conversation

nono
Copy link
Member

@nono nono commented Nov 8, 2023

No description provided.

@nono nono requested a review from a team as a code owner November 8, 2023 08:15
@nono nono merged commit 207a85f into master Nov 9, 2023
6 checks passed
@nono nono deleted the fix-panic branch November 9, 2023 08:11
Comment on lines +205 to +210
publicName, _ := settings.M["public_name"].(string)
// if the public name is not defined, use the instance's domain
if publicName == "" {
split := strings.Split(inst.DomainName(), ".")
publicName = split[0]
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks a lot like what the PublicName function does.

Suggested change
publicName, _ := settings.M["public_name"].(string)
// if the public name is not defined, use the instance's domain
if publicName == "" {
split := strings.Split(inst.DomainName(), ".")
publicName = split[0]
}
publicName, err := s.PublicName(inst)
if err != nil {
return fmt.Errorf("failed to fetch the settings: %w", err)
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but PublicName makes a request to CouchDB to load the settings document and I would prefer to avoid that as we already have this document loaded.

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.

3 participants