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:
parent
cb017e1275
commit
a23a6f9a0f
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue