An open API service indexing awesome lists of open source software.

https://github.com/obeim/fastify-auth-template

A secure authentication & authorization starter template built with Fastify, TypeScript, and Prisma, following OWASP security best practices.
https://github.com/obeim/fastify-auth-template

authentication authorization fastify nodejs owasp-top-10 postgres prisma rest-api typescript

Last synced: 23 days ago
JSON representation

A secure authentication & authorization starter template built with Fastify, TypeScript, and Prisma, following OWASP security best practices.

Awesome Lists containing this project

README

          

# Fastify Auth Template (TypeScript + Prisma)

A secure authentication & authorization starter template built with **Fastify**, **TypeScript**, and **Prisma**, following **OWASP security best practices**.

## Features

- **JWT Authentication**
- Access token stored in memory
- Refresh token stored in **HTTP-only secure cookies**
- **Role-based authorization**
- Example roles: `admin`, `user`
- **OWASP Security Standards**
- Secure cookie flags (`HttpOnly`, `Secure`, `SameSite`)
- Token rotation on refresh
- CORS with strict origin & credentials
- Input validation with [TypeBox](https://github.com/sinclairzx81/typebox)
- **Tech stack**
- [Fastify](https://fastify.io/) for blazing-fast backend
- [TypeScript](https://www.typescriptlang.org/) for type safety
- [Prisma](https://www.prisma.io/) for database ORM
- [PostgreSQL](https://www.postgresql.org/) database