login and authentication
login via totp authentication via access and refresh tokens
This commit is contained in:
parent
6696975bee
commit
e1ec65350d
28 changed files with 3750 additions and 0 deletions
25
src/data-source.ts
Normal file
25
src/data-source.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import "dotenv/config";
|
||||
import "reflect-metadata";
|
||||
import { DataSource } from "typeorm";
|
||||
import { user } from "./entity/user";
|
||||
import { refresh } from "./entity/refresh";
|
||||
import { Initial1724317398939 } from "./migrations/1724317398939-initial";
|
||||
|
||||
const dataSource = new DataSource({
|
||||
type: "mysql",
|
||||
host: process.env.NODE_ENV || process.env.DBMODE ? "localhost" : process.env.DB_HOST,
|
||||
port: 3306,
|
||||
username: process.env.DB_USERNAME,
|
||||
password: process.env.DB_PASSWORD,
|
||||
database: process.env.DB_NAME,
|
||||
synchronize: false,
|
||||
logging: process.env.NODE_ENV ? true : ["schema", "error", "warn", "log", "migration"],
|
||||
bigNumberStrings: false,
|
||||
entities: [user, refresh],
|
||||
migrations: [Initial1724317398939],
|
||||
migrationsRun: true,
|
||||
migrationsTransactionMode: "each",
|
||||
subscribers: [],
|
||||
});
|
||||
|
||||
export { dataSource };
|
Loading…
Add table
Add a link
Reference in a new issue