Skip to content

Commit

Permalink
[Temp] #61, login controller commented out unused route, TO BE REFACT…
Browse files Browse the repository at this point in the history
…ORED
  • Loading branch information
Type-Style committed May 16, 2024
1 parent a04e2c3 commit 6879f65
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/controller/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import { createJWT, createCSRF, validateCSRF } from '@src/scripts/token';

const router = express.Router();

router.get("/", baseSlowDown, baseRateLimiter, async function login(req: Request, res: Response, next: NextFunction) {
loginLimiter(req, res, () => {
const csrfToken = createCSRF(res, next);
res.locals = {...res.locals, text: 'start', csrfToken: csrfToken};
res.render("login-form");
});
});
// TODO refactor endpoint to get token
// router.get("/", baseSlowDown, baseRateLimiter, async function login(req: Request, res: Response, next: NextFunction) {
// loginLimiter(req, res, () => {
// const csrfToken = createCSRF(res, next);
// res.locals = {...res.locals, text: 'start', csrfToken: csrfToken};
// res.render("login-form");
// });
// });

router.post("/", loginSlowDown, async function postLogin(req: Request, res: Response, next: NextFunction) {
loginLimiter(req, res, async () => {
Expand Down

0 comments on commit 6879f65

Please sign in to comment.