Skip to content

how to writing own database driver?

NodeBB Development

Suggested Topics


  • Reset all database

    Solved NodeBB Development
    4
    0 Votes
    4 Posts
    2k Views
    C
    @frgilb I tried your solution: it's quick, it's secure and it's works :-). Thanks
  • Updating User Profile picture using Write API

    Unsolved NodeBB Development
    7
    0 Votes
    7 Posts
    3k Views
    G
    @pichalite Sigh alright, thanks for the help.
  • Creating own sso for login from other database

    NodeBB Development
    2
    0 Votes
    2 Posts
    1k Views
    yariplusY
    I am guessing on all of this, never done it before It sounds as if you want to override the local login strategy rather than provide an SSO service. To do this you need to provide a local login strategy to passportjs during that hook, just as the core does here: https://github.com/NodeBB/NodeBB/blob/master/src/routes/authentication.js#L43 Instead of controllers.authentication.localLogin, use your own callback function. It is passed (req, username, password, next) just as it is here. You would essentially the same thing that function does, but instead of using the local user info, use your own database to compare the username/passwords too. If the login is successful, you need to create a local user and attach an ID from your database entry to the user's local database entry, so you can look that up when the user logs in again. Also in the admin panel, change the registration type to none, so that users are required to have an account at your existing db.
  • Write-enabled API (Brainstorming)

    NodeBB Development
    23
    3 Votes
    23 Posts
    16k Views
    zaasmiZ
    @baris Please help nothing happened after save changes again at same screen. [image: hbSzuf6.png]
  • Database Backup

    NodeBB Development
    4
    0 Votes
    4 Posts
    2k Views
    julianJ
    Probably would be fine, but some may balk because it would allow a potentially compromised NodeBB app to read db dumps from other applications. In any case, because it's not the default, it can't be in core, because it would be broken for 99% of the users

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