feat: getMe on launch

This commit is contained in:
Zamitto 2024-10-21 15:01:43 -03:00
parent d801bad49e
commit df5f82d47f
5 changed files with 89 additions and 72 deletions

View file

@ -44,7 +44,8 @@ export class HydraApi {
return userSubscriptionRepository
.findOne({ where: { id: 1 } })
.then((userSubscription) => {
if (userSubscription?.status !== "active") return false;
if (!userSubscription) return false;
return (
!userSubscription.expiresAt ||
userSubscription!.expiresAt > new Date()