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: Replaces periods in email with underscores when creating a username. #351

Closed
wants to merge 1 commit into from
Closed

fix: Replaces periods in email with underscores when creating a username. #351

wants to merge 1 commit into from

Conversation

njhargis
Copy link

Closes #350.

@njhargis njhargis changed the title Replaces periods in email with underscores when creating a username. fix: Replaces periods in email with underscores when creating a username. Aug 15, 2022
@njhargis
Copy link
Author

Updated PR title to match conventional commits.

@@ -48,7 +48,8 @@ export default async function authorize(
identity.email
?.substring(0, identity.email?.indexOf("@"))
.replace(/[^a-zA-Z._]/g, "_")
.replace(/__/g, "_") ||
.replace(/__/g, "_")
.replace(/\./g, "_") ||
Copy link
Member

@koistya koistya Aug 16, 2022

Choose a reason for hiding this comment

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

@njhargis if you'd like to exclude dot characters from usernames, removing it from line 50 above might be a better tweak /[^a-zA-Z._]/g => /[^a-z0-9_]/gi.

Though, if usernames can support dot characters, that might be better for end users, similarly to Instagram usernames, where you can have usernames such as @site.com.

@njhargis njhargis closed this by deleting the head repository Mar 6, 2023
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.

Bug with emails that have "." in them breaks username requirements
2 participants