feat: improve UI for timespan inputs on admin page (#726)
* Define Timestamp type * Implement Timestamp utils * Implement Timespan input * Use timestamp input on config page * Add timespan type to config services * Refactor maxExpiration to use timespan type across services and components * Update sessionDuration to use timespan type in config and adjust token expiration logic * Update localized strings
This commit is contained in:
@@ -56,12 +56,13 @@ export class ShareService {
|
||||
|
||||
const expiresNever = moment(0).toDate() == parsedExpiration;
|
||||
|
||||
const maxExpiration = this.config.get("share.maxExpiration");
|
||||
if (
|
||||
this.config.get("share.maxExpiration") !== 0 &&
|
||||
maxExpiration.value !== 0 &&
|
||||
(expiresNever ||
|
||||
parsedExpiration >
|
||||
moment()
|
||||
.add(this.config.get("share.maxExpiration"), "hours")
|
||||
.add(maxExpiration.value, maxExpiration.unit)
|
||||
.toDate())
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
|
||||
Reference in New Issue
Block a user