Fixes before work

This commit is contained in:
Atridad Lahiji 2023-08-23 08:06:42 -06:00 committed by atridadl
parent 8ef8afa223
commit c261baeb57
No known key found for this signature in database
4 changed files with 15 additions and 15 deletions

View file

@ -23,7 +23,7 @@
"@trpc/next": "10.37.1", "@trpc/next": "10.37.1",
"@trpc/react-query": "10.37.1", "@trpc/react-query": "10.37.1",
"@trpc/server": "10.37.1", "@trpc/server": "10.37.1",
"@unkey/api": "^0.6.13", "@unkey/api": "^0.6.14",
"@upstash/ratelimit": "^0.4.3", "@upstash/ratelimit": "^0.4.3",
"@upstash/redis": "^1.22.0", "@upstash/redis": "^1.22.0",
"ably": "^1.2.43", "ably": "^1.2.43",

8
pnpm-lock.yaml generated
View file

@ -36,8 +36,8 @@ dependencies:
specifier: 10.37.1 specifier: 10.37.1
version: 10.37.1 version: 10.37.1
'@unkey/api': '@unkey/api':
specifier: ^0.6.13 specifier: ^0.6.14
version: 0.6.13 version: 0.6.14
'@upstash/ratelimit': '@upstash/ratelimit':
specifier: ^0.4.3 specifier: ^0.4.3
version: 0.4.3 version: 0.4.3
@ -1869,8 +1869,8 @@ packages:
eslint-visitor-keys: 3.4.3 eslint-visitor-keys: 3.4.3
dev: true dev: true
/@unkey/api@0.6.13: /@unkey/api@0.6.14:
resolution: {integrity: sha512-fYIph+wLd+lIuYqc2qXjQ52Zm/jDOhsLiZgOPNOlYzESU1ouU5Tm/9PNYb9lXgzeTqL3rU/EWtR8GoLHu/BfjA==} resolution: {integrity: sha512-d2tssSRf4Y4kCF44mloFcqphBenfWN5G2D1Iyz8EMmAoNi+ytvmHmmc1zZf4k3GhK68xLDA7uEO/b/1vtgD5qg==}
dev: false dev: false
/@upstash/core-analytics@0.0.6: /@upstash/core-analytics@0.0.6:

View file

@ -9,9 +9,7 @@ export const validateApiKey = async (key: string) => {
const res = await unkey.keys.verify({ const res = await unkey.keys.verify({
key, key,
}); });
// @ts-ignore This is broken... return res.result?.valid || false;
const isValid = res.result?.valid || (res.valid as boolean);
return isValid;
} catch { } catch {
return false; return false;
} }

View file

@ -41,14 +41,16 @@ export const onUserCreatedHandler = async (
} }
); );
userEmails.forEach((userEmail) => { if (userUpdateResponse.ok) {
void resend.sendEmail({ userEmails.forEach((userEmail) => {
from: "no-reply@sprintpadawan.dev", void resend.sendEmail({
to: userEmail, from: "no-reply@sprintpadawan.dev",
subject: "🎉 Welcome to Sprint Padawan! 🎉", to: userEmail,
react: Welcome({ name: userName }), subject: "🎉 Welcome to Sprint Padawan! 🎉",
react: Welcome({ name: userName }),
});
}); });
}); }
return userUpdateResponse.ok; return userUpdateResponse.ok;
}; };