[nodebb-plugin-session-sharing] Logins other user



  • I have the following user:

    {
    _id: ObjectId("579200c4e193d94b453f1d6f"),
    _key: "user:13",
    username: "ana",
    userslug: "ana",
    email: "ana@yahoo.com",
    joindate: 1469186244052,
    lastonline: 1469186244052,
    picture: "",
    fullname: "",
    location: "",
    birthday: "",
    website: "",
    signature: "",
    uploadedpicture: "",
    profileviews: 1,
    reputation: 0,
    postcount: 0,
    topiccount: 0,
    lastposttime: 0,
    banned: 0,
    status: "online",
    uid: 13,
    password: "EDITED",
    passwordExpiry: 0
    }

    And I have the following object with will be transformed to JSON WEB TOKEN:
    {"id":"13","username":"ana"}

    The problem is that the plugin creates a new user called ana115

    What can I do here?


  • Community Rep

    Looking at the code, it appears the plugin will not automatically associate your token's id with an existing user's uid when they overlap (likely for security reasons). It checks the database hash 'appId:uid' for the association. The hash fields are your app's id and the value is the associated uid. You should be able to manually create an association with an existing user by editing that hash.

    I think the mongo command would be like this:
    db.objects.update({ _key: "appId:uid" }, { $set: { "13": "13" } })


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.