Skip to content

Commit 2ee0246

Browse files
authored
Merge pull request #120 from pitzzahh/patch/csp
patch: improve csp
2 parents 38cbed8 + 089a4c3 commit 2ee0246

File tree

14 files changed

+161
-438
lines changed

14 files changed

+161
-438
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ GITHUB_CLIENT_SECRET=your-github-client-secret
1414
# Email Configuration
1515
PLUNK_BASE_URL="https://next-api.useplunk.com"
1616
PLUNK_SECRET_KEY=your-plunk-secret-key
17-
EMAIL_VERIFICATION_TIMEOUT_MINUTES=email-timeout-in-minutes
17+
PUBLIC_EMAIL_VERIFICATION_TIMEOUT_MINUTES=email-timeout-in-minutes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powertrackr",
3-
"version": "1.0.1",
3+
"version": "1.6.1",
44
"private": true,
55
"type": "module",
66
"scripts": {

src/app.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
66
<meta name="theme-color" content="#000000" />
77
<link rel="manifest" href="/manifest.json" />
8-
<link
9-
rel="preload"
10-
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap"
11-
as="style"
12-
/>
8+
<link rel="preconnect" href="https://fonts.googleapis.com" />
9+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1310
<link
1411
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap"
1512
rel="stylesheet"

src/lib/api/auth.remote.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
getPasswordResetSessionBy,
2727
updatePasswordResetSessionBy,
2828
} from "$/server/crud/password-reset-session-crud";
29-
import { createAndSendPasswordReset } from "$/server/email";
29+
import { createPasswordReset } from "$lib/server/email";
3030

3131
import {
3232
encrypt,
@@ -359,7 +359,7 @@ export const forgotPassword = form(forgotPasswordSchema, async (user) => {
359359
}
360360

361361
// Create password reset session and send email
362-
await createAndSendPasswordReset(userResult.id!, email);
362+
await createPasswordReset(userResult.id!, email);
363363

364364
return { success: true };
365365
});

src/lib/api/email.remote.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { command, getRequestEvent } from "$app/server";
1111
import { error } from "@sveltejs/kit";
12-
import { createAndSendEmailVerification } from "$/server/email";
12+
import { createEmailVerification } from "$lib/server/email";
1313

1414
export const resendVerification = command(async () => {
1515
const event = getRequestEvent();
@@ -32,15 +32,14 @@ export const resendVerification = command(async () => {
3232
}
3333

3434
try {
35-
const verification = await createAndSendEmailVerification(userId, email);
36-
37-
if (!verification) {
35+
const verification = await createEmailVerification(userId, email);
36+
if (verification) {
37+
return { success: true, sent: true, requestId: verification.id ?? null };
38+
} else {
3839
// Best-effort: the helper logs warnings on failure; surface a non-fatal response
39-
console.warn("createAndSendEmailVerification did not create a verification for user", userId);
40+
console.warn("Failed to create and send verification for user", userId);
4041
return { success: false, sent: false };
4142
}
42-
43-
return { success: true, sent: true, requestId: verification.id ?? null };
4443
} catch (e) {
4544
console.error("Failed to resend verification email for user", userId, e);
4645
error(500, "Failed to send verification email");

src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{...restProps}
2323
>
2424
{#snippet children({ checked })}
25-
<span class="pointer-events-none absolute start-2 flex size-3.5 items-center justify-center">
25+
<span class="pointer-events-none absolute inset-s-2 flex size-3.5 items-center justify-center">
2626
{#if checked}
2727
<CircleIcon class="size-2 fill-current" />
2828
{/if}

src/lib/server/__tests__/email.test.ts

Lines changed: 0 additions & 245 deletions
This file was deleted.

0 commit comments

Comments
 (0)