daedalusdevelopmentgroupauthmodule
v1.0.3
Published
A plug and play authentication module for the DaedalusDevelopmentGroup Suite
Downloads
240
Readme
Usage
The DaedalusDevelopmentGroupAuthModule
requires certain configurations to be explicitly provided. The module will fail to initialize if any of the following variables are missing:
mongoUri
: URI for MongoDB connection.jwtSecret
: Secret key for JWT token encryption.jwtExpiration
: Expiration duration for JWT tokens (e.g., '1h' for 1 hour).bcryptSaltRounds
: Number of salt rounds for bcrypt hashing.
Example Usage
import express from 'express';
import { initializeAuth } from 'DaedalusDevelopmentGroupAuthModule';
const app = express();
const options = {
mongoUri: 'mongodb://localhost:27017/your_database',
jwtSecret: 'your_secret_key',
jwtExpiration: '1h',
bcryptSaltRounds: 10,
};
initializeAuth(app, options);
app.listen(3000, () => console.log('Server running on port 3000'));