A modular authentication system providing both backend (Express, MongoDB) and frontend (React, Tailwind CSS) authentication components.
npm install uli-auth-backend uli-auth-frontend
const express = require("express");
const createAuthApp = require("uli-auth-backend");
const app = express();
const authApp = createAuthApp({ mongoURI: "mongodb://localhost:27017/mydb", routePrefix: "/auth" });
app.use(authApp);
app.listen(3000, () => console.log("Server running on port 3000"));
import AuthApp from "uli-auth-frontend";
function App() {
return <AuthApp apiUrl="https://your-backend.com/api" />;
}
export default App;
Method | Endpoint | Description |
---|---|---|
POST | /auth/register |
Register new user |
POST | /auth/login |
User login |
POST | /auth/verify-otp |
OTP verification |
GET | /users/profile |
Fetch user profile |
DELETE | /users/account |
Delete user account |