diff --git a/app/public/web.js b/app/public/web.js index 226058d..b84d6b2 100644 --- a/app/public/web.js +++ b/app/public/web.js @@ -46,7 +46,7 @@ class LGallery { } loadMoreItems () { - const numberOfItems = 100 + const numberOfItems = 80 if (this.index < this.items.length) { // Append thumbnails this.items diff --git a/app/src/index.ts b/app/src/index.ts index f40b7a8..56673b3 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -76,12 +76,10 @@ app.get('/share/:key/:mode(download)?', checkPassword, async (req, res) => { /* * [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) => { - await immich.handleShareRequest({ - key: toString(req.body.key), - password: toString(req.body.password) - }, res) + res.send(immich.encryptPassword(req.body.password)) }) /* diff --git a/app/views/password.ejs b/app/views/password.ejs index ec268be..f59aa4e 100644 --- a/app/views/password.ejs +++ b/app/views/password.ejs @@ -51,8 +51,8 @@ body: JSON.stringify(Object.fromEntries(formData.entries())) }) if (res.status === 200) { - document.documentElement.innerHTML = await res.text() - initLightGallery(<%- JSON.stringify(lgConfig) %>) // initLightGallery imported from web.js + const params = await res.json() + window.location = window.location + '?' + new URLSearchParams(params).toString() } } catch (e) { } }