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
Facebook provider stores user's non unique name as strapi unique username #6014
Comments
|
Thank you for reporting this issue. There is a workaround for this issue. DO NOT update the BUT you can create a new field |
|
I agree, as I tested the registration I found users when they register they could easily find their username was already taken. An option to make this non-unique or have another field as the username would be nice to have. |
|
We already discussed this in another issue (can't find it) I think we should use the email as unique identifier and let the username be whatever the user wants. |
|
I think that email could be the unique identifier. It would even be interesting if, when registering a user via Facebook (or other provider), he checked if the same email address already exists in the registered database to associate Facebook Login with the already registered user. |
|
Is anyone up to this issue? If not, I can work on this issue if that's okay? |
Do a PR =] |
… not taken. Fixes in a non-breaking way (among others) strapi#6014
|
I added a PR for this. In short itis an added check in Providers.js that checks if the username is taken. If it is taken it adds a random suffix to the username. Anyway if anyone ends up here and want the quick fix: And this between "Retrieve default role" and "Create the new user": |
|
@derrickmehaffy I would like to work on this issue. |
Describe the bug
After going through the facebook provider auth flow via /connect/facebook
the callback stores the user's facebook non unique name as the user's unique strapi username
In strapi-plugin-users-permissions/services/Providers.js > getProfile
line 174
There seem to be many Jim Laurie on facebook
This would mean that only one Jim Laurie could ever sign up on the site via facebook
Steps to reproduce the behavior
Expected behavior
username should be unique in case user logs in through facebook
Ideally, the user's profile url/handle would be the perfect fit for username
Although, this isn't available through graph api.
So the best bet is to use the user's facebook user id as his/her username
Code snippets
quick fix by dropping a customization in extensions/users-permissions/services/Providers.js
The text was updated successfully, but these errors were encountered: