mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-09 09:37:01 +02:00
refactor: run formatter
This commit is contained in:
@@ -345,7 +345,9 @@ export class AuthService {
|
||||
if (refreshToken) {
|
||||
const now = moment();
|
||||
const sessionDuration = this.config.get("general.sessionDuration");
|
||||
const maxAge = moment(now).add(sessionDuration.value, sessionDuration.unit).diff(now);
|
||||
const maxAge = moment(now)
|
||||
.add(sessionDuration.value, sessionDuration.unit)
|
||||
.diff(now);
|
||||
response.cookie("refresh_token", refreshToken, {
|
||||
path: "/api/auth/token",
|
||||
httpOnly: true,
|
||||
|
||||
@@ -36,8 +36,7 @@ export class ConfigService extends EventEmitter {
|
||||
if (configVariable.type == "boolean") return value == "true";
|
||||
if (configVariable.type == "string" || configVariable.type == "text")
|
||||
return value;
|
||||
if (configVariable.type == "timespan")
|
||||
return stringToTimespan(value);
|
||||
if (configVariable.type == "timespan") return stringToTimespan(value);
|
||||
}
|
||||
|
||||
async getByCategory(category: string) {
|
||||
|
||||
@@ -61,9 +61,7 @@ export class ShareService {
|
||||
maxExpiration.value !== 0 &&
|
||||
(expiresNever ||
|
||||
parsedExpiration >
|
||||
moment()
|
||||
.add(maxExpiration.value, maxExpiration.unit)
|
||||
.toDate())
|
||||
moment().add(maxExpiration.value, maxExpiration.unit).toDate())
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
"Expiration date exceeds maximum expiration date",
|
||||
|
||||
Reference in New Issue
Block a user