mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-17 04:33:15 +02:00
feat: direct file link
This commit is contained in:
@@ -26,10 +26,12 @@ export class ShareTokenSecurity implements CanActivate {
|
||||
include: { security: true },
|
||||
});
|
||||
|
||||
const isExpired =
|
||||
moment().isAfter(share.expiration) && !moment(share.expiration).isSame(0);
|
||||
|
||||
if (!share || isExpired) throw new NotFoundException("Share not found");
|
||||
if (
|
||||
!share ||
|
||||
(moment().isAfter(share.expiration) &&
|
||||
!moment(share.expiration).isSame(0))
|
||||
)
|
||||
throw new NotFoundException("Share not found");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user