fix: enforce gallery access and consolidate gallery workflows (#1357)
Harden gallery authentication and authorization, consolidate gallery workflows, and prevent token-bearing URLs from leaking through nginx request error logs.
This commit is contained in:
@@ -33,4 +33,15 @@ function toIso(value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
module.exports = { toIso };
|
||||
// Shared comparison boundary for SQLite epoch values and PostgreSQL Dates.
|
||||
// Invalid input stays NaN so access-control callers can fail closed.
|
||||
function toTimestamp(value) {
|
||||
if (value === null || value === undefined || value === '') return NaN;
|
||||
try {
|
||||
return new Date(toIso(value)).getTime();
|
||||
} catch (_) {
|
||||
return NaN;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { toIso, toTimestamp };
|
||||
|
||||
Reference in New Issue
Block a user