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
27
src/routes/index.ts
Normal file
27
src/routes/index.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import express from "express";
|
||||
import cors from "cors";
|
||||
|
||||
import type { Express } from "express";
|
||||
import errorHandler from "../middleware/errorHandler";
|
||||
import authenticate from "../middleware/authenticate";
|
||||
|
||||
import auth from "./auth";
|
||||
|
||||
export default (app: Express) => {
|
||||
app.set("query parser", "extended");
|
||||
app.use(express.json());
|
||||
app.use(
|
||||
express.urlencoded({
|
||||
extended: true,
|
||||
})
|
||||
);
|
||||
app.use(cors());
|
||||
app.options("*", cors());
|
||||
|
||||
app.use("/auth", auth);
|
||||
app.use(authenticate);
|
||||
app.use("/secured", (req, res) => {
|
||||
res.send("hallo");
|
||||
});
|
||||
app.use(errorHandler);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue