julianlam / nodebb-plugin-session-sharing

Allows login sessions from your app to persist in NodeBB
MIT License
86 stars 66 forks source link

Use plugin on old forum #100

Closed avraham1 closed 2 years ago

avraham1 commented 3 years ago

I have an existing forum, and I want to install the session-sharing plugin on it, and allow users to connect through my site. The problem - if I send a cookie with a user ID that already exists in the system before, the plugin does not connect it to its user, but creates a new user for it. I also want to allow veteran users to connect, is that possible?

julianlam commented 3 years ago

@avraham1 Normally, if there is no match based on the ID supplied, session sharing will check the email for a match (if passed in). Otherwise, unfortunately, you will need to manually add them to the database.

The key to update is the appId:uid sorted set (unless the settings override this to a different sorted set). You'll need to add entries to it for the existing users you want session-sharing to recognize, so the remote ID corresponds to a uid in the database.