Package Exports
- daedalusdevelopmentgroupauthmodule
- daedalusdevelopmentgroupauthmodule/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (daedalusdevelopmentgroupauthmodule) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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'));