initial commit - far from runnable

This commit is contained in:
Anika Raemer 2025-09-21 12:39:54 +02:00
commit db057ce342
8614 changed files with 1032171 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import * as jwt from "jsonwebtoken";
import * as bcrypt from "bcrypt";
import * as dotenv from "dotenv";
import { payload } from "../dtos/userDto";
dotenv.config();
const { JWT_SECRET = "" } = process.env;
export class encrypt {
static async encryptpass(password: string) {
return bcrypt.hashSync(password, 12);
}
static comparepassword(hashPassword: string, password: string) {
return bcrypt.compareSync(password, hashPassword);
}
static generateToken(payload: payload) {
return jwt.sign(payload, JWT_SECRET, { expiresIn: "1d" });
}
}