feat(user-auth): improve token refresh logic and default values

This commit is contained in:
carlosmonastyrski
2025-04-29 18:28:18 -03:00
parent 024ed0c0d8
commit 7bd61d88fc
9 changed files with 79 additions and 12 deletions
+4
View File
@@ -170,8 +170,12 @@ export const orgServiceFactory = ({
actorOrgId: string | undefined
) => {
await permissionService.getUserOrgPermission(userId, orgId, actorAuthMethod, actorOrgId);
const appCfg = getConfig();
const org = await orgDAL.findOrgById(orgId);
if (!org) throw new NotFoundError({ message: `Organization with ID '${orgId}' not found` });
if (!org.userTokenExpiration) {
return { ...org, userTokenExpiration: appCfg.JWT_REFRESH_LIFETIME };
}
return org;
};
/*