Details
- plugin version:
1.5.2
- NodeBB version:
4.10.1
- deployment: Cloudron
- DB: MongoDB
Issue description
Linking an existing account when OAuth login is used is not always working correctly
Steps to reproduce
OAuth configuration:
Create a user manually and verify the mail.
Login with OAuth where the same mail and even username is used.
A new user is created with $USERNAME 0 appended.
Log in with OAuth, same username and mail.
A second user is created:
Also tested with a non admin user with the same issue.
I have managed to get it working when enabling the following two options on another instance.
Use email as username (supercedes previous option).
Automatically confirm emails when email_verified is true.
But there was something else fishy.
When I first entered my credentials in the OAuth provider I got a white page on the OAuth provider , so maybe an upstream issue there.
But when I revisited NodeBB with a valid OAuth session cached and pressed login with OAuth again, I was correctly authed as the user and no second user was created.
Another thing I noticed.
The now 'linked' user has no details in his account that he has an OAuth account linked.

This could be useful.
Details
1.5.24.10.1Issue description
Linking an existing account when OAuth login is used is not always working correctly
Steps to reproduce
OAuth configuration:
Create a user manually and verify the mail.
Login with OAuth where the same mail and even username is used.
A new user is created with
$USERNAME 0appended.Log in with OAuth, same username and mail.
A second user is created:
Also tested with a non admin user with the same issue.
I have managed to get it working when enabling the following two options on another instance.
Use email as username (supercedes previous option).Automatically confirm emails when email_verified is true.But there was something else fishy.
When I first entered my credentials in the OAuth provider I got a white page on the OAuth provider , so maybe an upstream issue there.
But when I revisited NodeBB with a valid OAuth session cached and pressed login with OAuth again, I was correctly authed as the user and no second user was created.
Another thing I noticed.
The now 'linked' user has no details in his account that he has an OAuth account linked.