This is a basic example of how to implement OAT authentification with AdonisJS v6. It includes a simple user model and a basic authentification controller.
- Register a new user
- Login a user
- Logout the current user
- Get user details
- Clone the repository
git clone git@github.com:MaximeMRF/adonisjs-oat-auth-tutorial.git
- Install the dependencies
npm install
- Create a new .env file
cp .env.example .env
- Start the server
node ace serve
- Build the image
docker build -t oat-tutorial .
- Run the container
docker run -d --env-file .env.prod -p 3333:3333 oat-tutorial:latest
Save the container id to access it
- Run the migrations manually
docker exec -it <container_id> /bin/bash
# when you are inside the container
node ./bin/console.js migration:run --force
# then exit the container with ctrl + d
Now you can access the server on http://localhost:3333
🚀