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 Rocket.Chat auth module #3122

Merged
merged 1 commit into from
Sep 30, 2021
Merged

Conversation

deg0nz
Copy link
Contributor

@deg0nz deg0nz commented Feb 22, 2021

As mentioned in #2572, Wiki.js uses the wrong property to access a users' E-Mail address in the Rocket.Chat auth module.

This PR fixes this.

I have tested this change with the current dev branch on one of my servers and it's working.

Rocket.Chat's response contains an array containing all the emails a user has added to Rocket.Chat. The currently used property email does not exist in the response. Please see https://docs.rocket.chat/api/rest-api/methods/authentication/me.

Since we have no option to choose which E-Mail to use for the OAuth mechanism, I just assumed, we take the first one in the array and go for it.

Please tell me, if you are OK with this, since it can be considered as a dirty hack.
I can add some validation that checks, if the array is empty that throws an error or something.

@deg0nz
Copy link
Contributor Author

deg0nz commented Sep 29, 2021

@NGPixel is there a specific reason for this to be held back?

I would like to update my wiki.js server, but the update depends on this fix because my users are using rocketchat auth.

@NGPixel NGPixel merged commit ed3925b into requarks:dev Sep 30, 2021
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.

None yet

2 participants