Updated .dockerignore to remove unneeded files from container build. Updated docker-compose.yml with new environment variables. Updated README.md. Updated project description. Replaced DISABLE_AUTH with AUTH_DISABLE. Replaced SECURITY_CODE with AUTH_PASSWORD. Implemented AUTH_TOKEN for api authentication. Added migration guide.

This commit is contained in:
Glenn de Haan
2024-08-21 20:30:36 +02:00
parent f6c04e0098
commit 3ba8d33456
9 changed files with 94 additions and 50 deletions

View File

@@ -6,7 +6,7 @@ const jwt = require('../modules/jwt');
/**
* Global variables
*/
const authDisabled = (process.env.DISABLE_AUTH === 'true') || false;
const authDisabled = (process.env.AUTH_DISABLE === 'true') || false;
/**
* Verifies if a user is signed in
@@ -68,7 +68,7 @@ module.exports = {
}
// Check if password is correct
const passwordCheck = req.headers.authorization === `Bearer ${(process.env.SECURITY_CODE || "0000")}`;
const passwordCheck = req.headers.authorization === `Bearer ${(process.env.AUTH_TOKEN || "0000")}`;
if (!passwordCheck) {
res.status(403).json({
error: 'Forbidden',