You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies in advance if I got something wrong, but as far as I can see, it's impossible to use PassportLocalModel's methods within a transaction. For example, PassportLocalModel's register() method doesn't take arguments/doesn't return an object that would take a session object.
Code example:
constsession=awaitmongoose.startSession();session.startTransaction();constuser: Document<User>=awaitUserModel.register({ email,active: false}asUser&Document,password);// making this go into the session isn't possible as of now
As an alternative solution, even if the register function doesn't support transactions you can pass a user document created with a session. If something fails, it will be rolled back.
Apologies in advance if I got something wrong, but as far as I can see, it's impossible to use
PassportLocalModel
's methods within a transaction. For example,PassportLocalModel
'sregister()
method doesn't take arguments/doesn't return an object that would take a session object.Code example:
How I think it should work
The text was updated successfully, but these errors were encountered: