mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 23:17:12 +01:00
read password from env
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD
|
||||||
|
|
||||||
export function authenticateAdmin({
|
export function authenticateAdmin({
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
@@ -9,8 +11,11 @@ export function authenticateAdmin({
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: move at least to env variable
|
if (!ADMIN_PASSWORD) {
|
||||||
if (password !== 'secret') {
|
throw new Error('ADMIN_PASSWORD not set. Login disabled!')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (password !== ADMIN_PASSWORD) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user