mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 15:05:31 +08:00
extra init check to provide better error response
This commit is contained in:
parent
550a9fa711
commit
5710c9e997
1 changed files with 5 additions and 1 deletions
|
@ -79,8 +79,12 @@ function reject(req, res, message) {
|
|||
}
|
||||
|
||||
function checkCredentials(req, res, next) {
|
||||
if (!sqlInit.isDbInitialized()) {
|
||||
res.status(400).send('Database is not initialized yet.');
|
||||
}
|
||||
|
||||
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 dbUsername = optionService.getOption('username');
|
||||
|
|
Loading…
Reference in a new issue