Update password protected galleries
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ class LGallery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadMoreItems () {
|
loadMoreItems () {
|
||||||
const numberOfItems = 100
|
const numberOfItems = 80
|
||||||
if (this.index < this.items.length) {
|
if (this.index < this.items.length) {
|
||||||
// Append thumbnails
|
// Append thumbnails
|
||||||
this.items
|
this.items
|
||||||
|
|||||||
+2
-4
@@ -76,12 +76,10 @@ app.get('/share/:key/:mode(download)?', checkPassword, async (req, res) => {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* [ROUTE] Receive an unlock request from the password page
|
* [ROUTE] Receive an unlock request from the password page
|
||||||
|
* Returns an encrypted unlock key which lasts for 1 hour
|
||||||
*/
|
*/
|
||||||
app.post('/share/unlock', async (req, res) => {
|
app.post('/share/unlock', async (req, res) => {
|
||||||
await immich.handleShareRequest({
|
res.send(immich.encryptPassword(req.body.password))
|
||||||
key: toString(req.body.key),
|
|
||||||
password: toString(req.body.password)
|
|
||||||
}, res)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -51,8 +51,8 @@
|
|||||||
body: JSON.stringify(Object.fromEntries(formData.entries()))
|
body: JSON.stringify(Object.fromEntries(formData.entries()))
|
||||||
})
|
})
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
document.documentElement.innerHTML = await res.text()
|
const params = await res.json()
|
||||||
initLightGallery(<%- JSON.stringify(lgConfig) %>) // initLightGallery imported from web.js
|
window.location = window.location + '?' + new URLSearchParams(params).toString()
|
||||||
}
|
}
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user