NodeBB / NodeBB/nodebb-plugin-sso-oauth2-multiple

New user being created instead of using existing

Open
#68 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
14
Forks
9
Avg merge
1m
Merged PRs (30d)
7

Description

Hi there,

I am confused on how to set up the plugin to use an existing user based on their email address.

Currently, as soon as I log in with my own OAuth2 Strategy (which comes with the verified email flag set), it still creates another user:
image

I thought it would help to enable Use email as username (overrides previous option) in Preferences, but that did not help either. I also checked Automatically confirm emails when email_verified is true'.

image

I have had a look at the login code and if I am not mistaken it is supposed to do this already, so there seems to be something wrong with it.
https://github.com/NodeBB/nodebb-plugin-sso-oauth2-multiple/blob/43c74140829a6d9141330c3609967c2530f48b70/library.js#L226-L229

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in library.js at lines 226-229 and trace the existing-user lookup during OAuth login. Reproduce the login with an existing email, the verified-email flag, and the listed Preferences options; done means the OAuth login reuses the existing user instead of creating another account.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.