feat: expiry time

This commit is contained in:
2025-06-09 11:47:13 +03:00
parent 2bbc34f1cb
commit 7e94b5c44f
2 changed files with 14 additions and 5 deletions

View File

@@ -23,10 +23,11 @@ async function getUrlApi(email: string) {
await redis.set("inbound", JSON.stringify(inbound), "EX", 3600);
const users: ClientSettings = JSON.parse(inbound.settings);
const user = users.clients.find((user) => user.email === email);
console.log(user);
if (!user) {
throw new Error("User not found");
}
return getValidUrl({ email, id: user.id });
return { url: getValidUrl({ email, id: user.id }), expiryTime: user.expiryTime };
}
export async function getUrl(initData: string = "") {
try {