login and authentication

login via totp
authentication via access and refresh tokens
This commit is contained in:
Julian Krauser 2024-08-22 11:40:31 +02:00
parent 6696975bee
commit e1ec65350d
28 changed files with 3750 additions and 0 deletions

23
src/index.ts Normal file
View file

@ -0,0 +1,23 @@
import "dotenv/config";
import express from "express";
declare global {
namespace Express {
export interface Request {
userId: string;
username: string;
rights: Array<string>;
}
}
}
import { dataSource } from "./data-source";
dataSource.initialize();
const app = express();
import router from "./routes/index";
router(app);
app.listen(process.env.SERVER_PORT, () => {
console.log(`listening on *:${process.env.SERVER_PORT}`);
});