julianlam / nodebb-plugin-session-sharing

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

Cookie verified @ jwt.io - login not working #11

Closed ludberg closed 8 years ago

ludberg commented 8 years ago

I got my cookie verified and checked so it contains the necessary data (id, email) but login doesn't work.

Double checked the secret, cookie name and all parameters. The user I'm trying to login exists.

How can I debug this further?

ludberg commented 8 years ago

I got it working by also passing username. First tried with an empty username, didn't work. Second, tried without username so to login my users with only id/email but that didn't work.

When I also include a username, it works.

Is this how it's suppose to work?

PanicIsReal commented 8 years ago

@ludberg From the readme on the front:

You are required to pass in at least id and (not or) username. If you specify firstName or lastName, username is no longer required.

julianlam commented 8 years ago

Thanks @gacnt :smile:

I require username so I can create the user if they do not already have an association. I suppose the username can just be the email, but it does look better with a username.

ludberg commented 8 years ago

Ahh, lesson learned :)

I'm trying to migrate away from usernames so would it be possible to make this work with only email?

I have disabled local login all together as well as change username.

Thanks!

julianlam commented 8 years ago

Hm, you could always pass in the email in the username property. That should work.