split in env required and dynamic values
This commit is contained in:
parent
f32143b7ac
commit
730c25a9a1
35 changed files with 491 additions and 198 deletions
|
@ -1,10 +1,8 @@
|
|||
import { dataSource } from "../data-source";
|
||||
import { refresh } from "../entity/refresh";
|
||||
import { PWA_REFRESH_EXPIRATION, REFRESH_EXPIRATION } from "../env.defaults";
|
||||
import DatabaseActionException from "../exceptions/databaseActionException";
|
||||
import InternalException from "../exceptions/internalException";
|
||||
import SettingHelper from "../helpers/settingsHelper";
|
||||
import { StringHelper } from "../helpers/stringHelper";
|
||||
import UserService from "../service/management/userService";
|
||||
import { CreateRefreshCommand, DeleteRefreshCommand } from "./refreshCommand";
|
||||
import ms from "ms";
|
||||
|
||||
|
@ -25,8 +23,8 @@ export default abstract class RefreshCommandHandler {
|
|||
token: refreshToken,
|
||||
userId: createRefresh.userId,
|
||||
expiry: createRefresh.isFromPwa
|
||||
? new Date(Date.now() + ms(PWA_REFRESH_EXPIRATION))
|
||||
: new Date(Date.now() + ms(REFRESH_EXPIRATION)),
|
||||
? new Date(Date.now() + ms(SettingHelper.getSetting("session.pwa_refresh_expiration") as ms.StringValue))
|
||||
: new Date(Date.now() + ms(SettingHelper.getSetting("session.refresh_expiration") as ms.StringValue)),
|
||||
})
|
||||
.execute()
|
||||
.then((result) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue