tests: get rid of useless csrf.njk template
This commit is contained in:
parent
ef51d128f1
commit
da38fdaf72
@ -2,6 +2,7 @@ import useApp from "./_app";
|
|||||||
import Controller from "../src/Controller";
|
import Controller from "../src/Controller";
|
||||||
import supertest from "supertest";
|
import supertest from "supertest";
|
||||||
import TestApp from "../src/TestApp";
|
import TestApp from "../src/TestApp";
|
||||||
|
import CsrfProtectionComponent from "../src/components/CsrfProtectionComponent";
|
||||||
|
|
||||||
let app: TestApp;
|
let app: TestApp;
|
||||||
useApp(async (addr, port) => {
|
useApp(async (addr, port) => {
|
||||||
@ -10,7 +11,7 @@ useApp(async (addr, port) => {
|
|||||||
this.use(new class extends Controller {
|
this.use(new class extends Controller {
|
||||||
public routes(): void {
|
public routes(): void {
|
||||||
this.get('/', (req, res) => {
|
this.get('/', (req, res) => {
|
||||||
res.render('test/csrf.njk');
|
res.send(CsrfProtectionComponent.getCsrfToken(req.getSession()));
|
||||||
}, 'csrf_test');
|
}, 'csrf_test');
|
||||||
|
|
||||||
this.post('/', (req, res) => {
|
this.post('/', (req, res) => {
|
||||||
|
@ -1 +0,0 @@
|
|||||||
{{ getCsrfToken() }}
|
|
Loading…
Reference in New Issue
Block a user