Unknown api error

Technical Support

Suggested Topics


  • 2 Votes
    1 Posts
    168 Views

    Hello,
    I created some accounts with the api/v3, but those accounts can't log in by email on the forum, and consequently can't log in with session sharing plugin.

    I searched a long time, because this used to work on nodebb v1.15.
    But on v1.18, some db objects are only set after the call of confirmByUid function :

    ['email:uid', uid, currentEmail.toLowerCase()], ['email:sorted', 0, `${currentEmail.toLowerCase()}:${uid}`], [`user:${uid}:emails`, Date.now(), `${currentEmail}:${Date.now()}`]

    So you have to confirm each account before the plugin "session sharing" works with them.

    To resolve this, i made a custom plugin and used the "confirmByUid" function :

    library.js :

    const Users = require.main.require('./src/user') var Plugin = { onCreateUser: function (postData) { const { user } = postData; Users.email.confirmByUid(user.uid); Topics.markAllRead(user.uid); } }

    plugin.json :

    "library": "./library.js", "hooks": [ { "hook": "action:user.create", "method": "onCreateUser" }, ]

    I hope this can help ;).

  • 0 Votes
    3 Posts
    387 Views

    @nhl-pl

    I upgraded to 1.16.2 and deletion works for other users but not for 2 that tried to delete their own accounts.
    One of them wants the account to be deleted, the other one wants it to be restored. How do I deal with those cases?

  • 0 Votes
    1 Posts
    541 Views

    Hello,

    I try to confirm an account (email) with the API but it doesn't work.
    I try to do a PUT with email:confirmed but doesn't work too.

    Is it possible with write api ?

    Thanks

  • 0 Votes
    11 Posts
    2k Views

    @pitaj Thanks! With node v8.7.0 and npm v5.4.2, I was able to run ./nodebb upgrade and now I'm a proud member of the nodebb v1.7.4 club.

    alt text

  • 0 Votes
    4 Posts
    2k Views

    Hello.
    Please try npm update
    Afterwards do ./nodebb upgrade

    This will force an update on the dependencies. The second command updates NodeBB