Quick Start
Prerequisites
Ensure you have Julia installed.
Clone the repository and install dependencies:
import Pkg Pkg.activate(".") Pkg.add("https://github.com/Thiago-Simoes/OrionAuth.jl") using OrionAuth
Configuration
Create a .env
file in the repository root with:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=pass
DB_NAME=dbname
DB_PORT=3306
OrionORM_LOG_LEVEL=error
ORIONAUTH_SECRET=your_secret_key_here
ORIONAUTH_ALGORITHM=HS512
ORIONAUTH_EXPIRATION=3600
ORIONAUTH_ISSUER=OrionAuth
ORIONAUTH_DBPREFIX=OrionAuth_
ORIONAUTH_MIN_PASSWORD_ITTERATIONS=25000
Initializing the Package
In your Julia script or REPL, load and initialize OrionAuth:
using OrionAuth
OrionAuth.init!() # Loads all modules, including auth and JWT.
User Operations
Signing Up
Create a new user with:
user = OrionAuth.signup("user@example.com", "John Doe", "securePassword123")
println("User created with UUID: ", user.uuid)
Signing In
Authenticate a user with:
user = OrionAuth.signin("user@example.com", "securePassword123")
println("User signed in successfully!")