19 lines
617 B
TypeScript
19 lines
617 B
TypeScript
// src/routes/join/+page.ts
|
|
import type { PageLoad } from './$types';
|
|
|
|
// Define the shape of data passed to the page component
|
|
export interface JoinPageLoadData {
|
|
codeFromUrl?: string | null; // Code extracted from URL, if present
|
|
}
|
|
|
|
export const load: PageLoad<JoinPageLoadData> = ({ url }) => {
|
|
// Check if a 'code' query parameter exists in the URL
|
|
const code = url.searchParams.get('code');
|
|
|
|
console.log(`Join page load: Checking for code in URL. Found: ${code}`);
|
|
|
|
// Return the code (or null if not found) so the page component can access it
|
|
return {
|
|
codeFromUrl: code
|
|
};
|
|
}; |