wiki-v1
wiki-v1 copied to clipboard
Adding Roles to users logging in with OAuth providers
Hello,
I would like to add roles to a user that has been authorized by Github login, but the name appears to be missing.
Actual behavior
User is created after signing in with a GitHub account but is missing the user name.
Expected behavior
Expected that the user would have a name assigned.

Steps to reproduce the behavior
- Vanilla install for WikiJS
- Create GitHub Secret/ID and update the config.yml
- Login with Github Account
- Login as admin and navigate to users page
Thanks.
Hello,
I figured out what is causing the issue... When a user logs in from GitHub for the first time, the name is either null or empty when the record is created:

Once the user assigns a name to themselves then they show up for administration:

But the user may never assign themselves a name, but they should always be able to be handled through the administration panel.
Suggestions for the change:
-
When a user logs in from OAuth, create a standard name "Default User", "User1023023", etc... I hesitate to use emails as usernames due to spam/email name sensitivity concerns...
-
Administration Panel should detect if the name is null or empty and populate a wrapped link. A link should always be populated.
<a href="/admin/users/5bbacaa881c0e820d7ccdc0d">Default User/Not Defined</a>
What do you think? Are you still accepting pull requests for 1.X?
Yes PRs are still accepted for 1.x as long as they are bug fixes, not new features or introducing breaking changes.
Confirmed that in version v1.0.102 if a social (github) user adds a name, then they can be administered.