1
0
Fork 0
mirror of https://github.com/alangrainger/immich-public-proxy.git synced 2024-12-28 03:41:58 +00:00

Fix #29 Download all password albums

This commit is contained in:
Alan Grainger 2024-12-01 18:35:03 +13:00
parent 0bd8785b01
commit 5bf615a400

View file

@ -7,6 +7,7 @@ import { AssetType, ImageSize } from './types'
import { decrypt } from './encrypt' import { decrypt } from './encrypt'
import { log, toString, addResponseHeaders } from './functions' import { log, toString, addResponseHeaders } from './functions'
// Extend the Request type with a `password` property
declare module 'express-serve-static-core' { declare module 'express-serve-static-core' {
interface Request { interface Request {
password?: string; password?: string;
@ -25,6 +26,9 @@ app.use('/share/static', express.static('public', { setHeaders: addResponseHeade
// Serve the same assets on /, to allow for /robots.txt and /favicon.ico // Serve the same assets on /, to allow for /robots.txt and /favicon.ico
app.use(express.static('public', { setHeaders: addResponseHeaders })) app.use(express.static('public', { setHeaders: addResponseHeaders }))
/**
* Middleware to decode an encrypted password sent from the frontend (if provided)
*/
const checkPassword = (req: Request, res: Response, next: NextFunction) => { const checkPassword = (req: Request, res: Response, next: NextFunction) => {
if (req.query?.cr && req.query?.iv) { if (req.query?.cr && req.query?.iv) {
try { try {