wiki-v1 icon indicating copy to clipboard operation
wiki-v1 copied to clipboard

Adding Roles to users logging in with OAuth providers

Open saucepleez opened this issue 7 years ago • 3 comments

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

image 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. image

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.

saucepleez avatar Oct 08 '18 03:10 saucepleez

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:

image

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

image

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?

saucepleez avatar Oct 11 '18 16:10 saucepleez

Yes PRs are still accepted for 1.x as long as they are bug fixes, not new features or introducing breaking changes.

NGPixel avatar Oct 12 '18 02:10 NGPixel

Confirmed that in version v1.0.102 if a social (github) user adds a name, then they can be administered.

constructive-realities avatar Nov 12 '18 19:11 constructive-realities