Fix #29 Download all password albums
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user