An implementation of AdonisJS auth user provider using the mongoose ORM.
Make sure to read the documentation for the Custom user provider and then go through the implementation of MongoDBAuthProvider.
- The source code is stored inside the
providers/MongoDbAuthProvider/index.tsfile. - The provider is registerd with the auth module inside the
providers/AppProvider.tsfile. - Everything else is just using the same AdonisJS API's to login and authenticate a user.
- Clone the repo
- Run
npm installto install the dependencies - Copy the
.env.examplefile to.env - Make sure you have MongoDB installed and double check the
start/mongoose.tsfile to check the connection details - Create a dummy user using the REPL.
- Open browser and try login