Authentication & Authorization
@inceptools/auth
Authentication and authorization made simple for your applications.
Simplify Authentication
@inceptools/auth will provide a comprehensive authentication and authorization solution for your applications.
Multiple Auth Providers
Support for OAuth providers like Google, GitHub, and more, as well as email/password authentication.
Role-Based Access Control
Easily define and enforce role-based access control for your application's routes and resources.
JWT Authentication
Secure, stateless authentication using JSON Web Tokens with configurable expiration and refresh.
Middleware Support
Easy-to-use middleware for protecting routes and enforcing authentication requirements.
Security Best Practices
Built-in protection against common security vulnerabilities like CSRF, XSS, and more.
User Management
Built-in user management with registration, login, password reset, and profile management.
import { AuthService } from "@inceptools/auth";
// Initialize auth service
const authService = new AuthService({
providers: ["google", "github"],
jwtSecret: process.env.JWT_SECRET,
cookieOptions: {
secure: process.env.NODE_ENV === "production",
sameSite: "lax"
}
});
// Protect routes
app.get("/protected", authService.requireAuth(), (req, res) => {
res.json({ user: req.user });
});
// Role-based access control
app.get("/admin",
authService.requireAuth(),
authService.requireRole("admin"),
(req, res) => {
res.json({ message: "Admin dashboard" });
}
);
Simple API for Complex Auth
@inceptools/auth will provide a clean, intuitive API that makes implementing authentication and authorization in your application straightforward.
- Easy integration with popular frameworks
- Flexible configuration options
- Comprehensive documentation and examples
- TypeScript support with full type safety
Be the First to Know
Subscribe to our newsletter to be notified when @inceptools/auth is released.