lucia-auth / examples

A collection of example projects built with Lucia
MIT License
171 stars 41 forks source link

Mongoose adapter - insertOne doesn't exist #27

Closed ArthurOnTime closed 4 months ago

ArthurOnTime commented 4 months ago

At the moment, using mongoose with the mongodb adapter doesn't work.

insertOne() doesn't exist in mongoose. mongoose uses create() instead.

line 58 : replacing await this.Session.insertOne(value); // MUST be replaced for Mongoose by await this.Session.create(value); // WORKS for Mongoose does the trick for mongoose but won't probably work for mongodb adapter.

Maybe using the save()collection method which I believe works both in mongoose and mongodb could be the simplest solution to avoid creating a dedicated mongoose adapter ?

ArthurOnTime commented 4 months ago

Issue extended and recreated at the right place : https://github.com/lucia-auth/lucia/issues/1440

pilcrowOnPaper commented 4 months ago

Closing this in favor of https://github.com/lucia-auth/lucia/issues/1440