mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
server-ts: Convert routes/login
This commit is contained in:
@@ -8,19 +8,10 @@ import passwordEncryptionService = require('./encryption/password_encryption');
|
||||
import config = require('./config');
|
||||
import passwordService = require('./encryption/password');
|
||||
import type { NextFunction, Request, Response } from 'express';
|
||||
import { AppRequest } from '../routes/route-interface';
|
||||
|
||||
const noAuthentication = config.General && config.General.noAuthentication === true;
|
||||
|
||||
interface AppRequest extends Request {
|
||||
headers: {
|
||||
authorization?: string;
|
||||
"trilium-cred"?: string;
|
||||
}
|
||||
session: {
|
||||
loggedIn: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
function checkAuth(req: AppRequest, res: Response, next: NextFunction) {
|
||||
if (!sqlInit.isDbInitialized()) {
|
||||
res.redirect("setup");
|
||||
|
||||
Reference in New Issue
Block a user