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

Sanitize username #6

Open
unrainer opened this issue Nov 26, 2021 · 1 comment
Open

Sanitize username #6

unrainer opened this issue Nov 26, 2021 · 1 comment

Comments

@unrainer
Copy link

Hi,
my peertube instance is linked to an oauth2 server by plugin auth-oauth2, so new users can sign up this way. Unfortunately the oauth-server policies for usernames allow some special characters e.g. john-doe.whoever, which are not allowed for username in peertube.
Is there a way, to sanitize the username value before sending it to peertube, or to configure peertube to accept special characters?

Thx a lot for any suggestions!

@lpotcgi
Copy link

lpotcgi commented Jan 21, 2022

Hi,
I encountered the same issue. How can I simply replace all not allowed characters by HTML escape corresponding values at the beginning of the oAuth connection?

john-doe.whoever => john_045doe.whoever
john_doe.whoever => john_095doe.whoever
john#doe.whoever => john_035doe.whoever
john_095doe.whoever => john_095095doe.whoever

It's a little bit ugly.

A more simple approach could be to transform '-' by '' and to forbid all other special characters including ''.
In fact, '-' is very common, all other special characters are rare.

This PR works fine for me : #4

Thanks a lot.

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

No branches or pull requests

2 participants