mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: forward headers during requests where needed
this is mainly just so any ip headers like cf-connecting-ip are forwarded for rate limiting
This commit is contained in:
@@ -2,10 +2,11 @@ import { apiUrl } from '$lib/server/api';
|
||||
import { extractError } from '$lib/utils/misc';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load = async ({ url }) => {
|
||||
export const load = async ({ url, request }) => {
|
||||
const token = url.searchParams.get('token');
|
||||
if (token) {
|
||||
const res = await fetch(`${apiUrl}/api/auth/verify-email?token=${token}`);
|
||||
const headers = new Headers(request.headers);
|
||||
const res = await fetch(`${apiUrl}/api/auth/verify-email?token=${token}`, { headers });
|
||||
if (!res.ok) {
|
||||
const json = await res.json().catch();
|
||||
const message = extractError(json);
|
||||
|
||||
Reference in New Issue
Block a user