feat: check if secret is expired before checking if secret has password

This commit is contained in:
lemmyMwaura
2024-08-07 20:55:37 +03:00
parent 69fe5bf71d
commit b0a5023723
6 changed files with 42 additions and 34 deletions
@@ -80,7 +80,7 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>
orgId: req.permission?.orgId
});
// only return secret if it exists and has no password set
// return undefined if it does not exist, has password set or has no more views allowed.
if (!sharedSecret || sharedSecret.password) return undefined;
return {