Skip to content

MaximeMRF/adonisjs-oat-auth-tutorial

Repository files navigation

Basic OAT authentification example with AdonisJS v6

Description

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.

Features

  • Register a new user
  • Login a user
  • Logout the current user
  • Get user details

Installation

  1. Clone the repository
git clone git@github.com:MaximeMRF/adonisjs-oat-auth-tutorial.git
  1. Install the dependencies
npm install
  1. Create a new .env file
cp .env.example .env
  1. Start the server
node ace serve

Deploy to docker

  1. Build the image
docker build -t oat-tutorial .
  1. Run the container
docker run -d --env-file .env.prod -p 3333:3333 oat-tutorial:latest

Save the container id to access it

  1. 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 🚀

Steps explanation

🇬🇧 Read the tutorial

🇫🇷 Lire le tutoriel

About

OAT authentication with Adonisjs v6 (Register/Login/Logout)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published