Browse Source

Fix: reset onetimelink expiration instead of failing (#2370)

* update expiresAt instead of failing

* add changelog
pull/2375/head
Bernd Storath 6 months ago
committed by GitHub
parent
commit
261da431e7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6
      src/server/database/repositories/oneTimeLink/service.ts

1
CHANGELOG.md

@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Allow empty DNS (https://github.com/wg-easy/wg-easy/pull/2052, https://github.com/wg-easy/wg-easy/pull/2057) - Allow empty DNS (https://github.com/wg-easy/wg-easy/pull/2052, https://github.com/wg-easy/wg-easy/pull/2057)
- Don't include keys in API responses (https://github.com/wg-easy/wg-easy/pull/2015) - Don't include keys in API responses (https://github.com/wg-easy/wg-easy/pull/2015)
- Try all QR ecc levels (https://github.com/wg-easy/wg-easy/pull/2288) - Try all QR ecc levels (https://github.com/wg-easy/wg-easy/pull/2288)
- Update OnetimeLink expiry on reuse (https://github.com/wg-easy/wg-easy/pull/2370)
- Removed ARMv7 support (https://github.com/wg-easy/wg-easy/pull/2369) - Removed ARMv7 support (https://github.com/wg-easy/wg-easy/pull/2369)
## Docs ## Docs

6
src/server/database/repositories/oneTimeLink/service.ts

@ -16,6 +16,12 @@ function createPreparedStatement(db: DBType) {
oneTimeLink: sql.placeholder('oneTimeLink'), oneTimeLink: sql.placeholder('oneTimeLink'),
expiresAt: sql.placeholder('expiresAt'), expiresAt: sql.placeholder('expiresAt'),
}) })
.onConflictDoUpdate({
target: oneTimeLink.id,
set: {
expiresAt: sql.placeholder('expiresAt') as never as string,
},
})
.prepare(), .prepare(),
erase: db erase: db
.update(oneTimeLink) .update(oneTimeLink)

Loading…
Cancel
Save