1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-07 06:25:21 +02:00

feat: password hash reading from env added

This commit is contained in:
Umang G. Patel 2022-04-21 23:37:42 +05:30
parent cb017e1275
commit a23a6f9a0f

View file

@ -1,6 +1,6 @@
import database from '../utils/database/index';
import * as dotenv from 'dotenv';
const db = database['password'];
dotenv.config();
export interface UserData {
passHash?: string;
@ -31,7 +31,9 @@ class User {
* @returns {Promise<User>}
*/
public static async get(): Promise<User> {
const userData: UserData = await db.findOne({});
const userData: UserData = {
passHash: process.env.PASSHASH,
};
return new User(userData);
}