julianlam / nodebb-plugin-session-sharing

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

Can you change username / picture upon re-logging in #6

Closed PanicIsReal closed 7 years ago

PanicIsReal commented 8 years ago

I'm using this plugin so people don't have to re-register to use the forums.

Right now I have code set to set the username and picture dynamically. :

let token = jwt.sign({
           "id": parseInt(user.id),
           "username": (user.Characters.length === 0) ? user.username : user.Characters[0].character_name,
           "picture": (user.Characters.length === 0) ? undefined : "http://render-api-us.worldofwarcraft.com/static-render/us/"+ user.Characters[0].character_pic,
           "email": user.email
       }, '');

I'm able to successfully login to the forums, but the username and picture doesn't change, it just seems to stay to what I originally had

I'm using the master branch version of NodeBB, is this not how the username or picture field was intended? Not sure what to do about this.

Also I noticed, after changing settings in the shared-session plugin on the admin panel, the settings don't seem to be there after reloading the page, the secret field is empty, so is the username. I don't know if this is because of me being on mobile doing this, or if it's because of security or something.

Any feedback would be greatly appreciated thanks.

julianlam commented 8 years ago

Hello @Gacnt, how up-to-date is your master branch? You'll need one within the last week or so to use with this plugin, or the ACP page will stay blank and not save.

As for the username and picture, those values are only used when creating the user. We don't update the user with the passed-in information.

Perhaps I can add that in for you if that's what you expected...

PanicIsReal commented 8 years ago

That would be amazing, or a Boolean to set these on each login or something @julianlam my version is as recent as 10 minutes prior to this issue. Thanks!

{ refreshUser: true }

PanicIsReal commented 8 years ago

@julianlam I would like to resolve this with #8

PanicIsReal commented 8 years ago

I'm going to open a separate issue for the settings not saving

julianlam commented 7 years ago

Fixed in v3.1.8