1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-07 06:25:21 +02:00

Add error on auth page

This commit is contained in:
n0str 2022-04-10 18:21:42 +03:00
parent c750d80b8c
commit e559d70e73
2 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,5 @@
import express, { Request, Response } from 'express';
import path from 'path';
import config from 'config';
import cookieParser from 'cookie-parser';
import morgan from 'morgan';
import rcParser from './utils/rcparser';
@ -8,9 +7,9 @@ import routes from './routes';
import HttpException from './exceptions/httpException';
const app = express();
const localConfig = rcParser.getConfiguration();
const config = rcParser.getConfiguration();
app.locals.config = localConfig;
app.locals.config = config;
// view engine setup
app.set('views', path.join(__dirname, './', 'views'));
app.set('view engine', 'twig');
@ -20,7 +19,8 @@ app.use(morgan('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(cookieParser());
app.use(express.static(config.get('uploads')));
app.use(express.static(path.join(__dirname, '../../public')));
app.use('/', routes);

View file

@ -8,6 +8,9 @@
<p>
Enter a password to access pages editing
</p>
<p>
{{ header }}
</p>
<input type="hidden" name="_csrf" value={{ csrfToken }}>
<input type="password" name="password" placeholder="Password">
<input type="submit" value="Login">