mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
extra init check to provide better error response
This commit is contained in:
parent
550a9fa711
commit
5710c9e997
@ -79,8 +79,12 @@ function reject(req, res, message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkCredentials(req, res, next) {
|
function checkCredentials(req, res, next) {
|
||||||
|
if (!sqlInit.isDbInitialized()) {
|
||||||
|
res.status(400).send('Database is not initialized yet.');
|
||||||
|
}
|
||||||
|
|
||||||
const header = req.headers['trilium-cred'] || '';
|
const header = req.headers['trilium-cred'] || '';
|
||||||
const auth = new Buffer.from(header, 'base64').toString();console.log("auth", auth);
|
const auth = new Buffer.from(header, 'base64').toString();
|
||||||
const [username, password] = auth.split(/:/);
|
const [username, password] = auth.split(/:/);
|
||||||
|
|
||||||
const dbUsername = optionService.getOption('username');
|
const dbUsername = optionService.getOption('username');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user