1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-15 07:35:11 +00:00

refactor: do not force redirects to happen on the server (#481)

This commit is contained in:
Alessandro (Ale) Segala
2025-04-25 04:09:52 +09:00
committed by GitHub
parent 8e66af627a
commit 662506260e
10 changed files with 31 additions and 26 deletions

View File

@@ -1,7 +1,8 @@
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
// Alias for /login/alternative/code
export function GET({ url }) {
export const load: PageLoad = async ({ url }) => {
let targetPath = '/login/alternative/code';
if (url.searchParams.has('redirect')) {
targetPath += `?redirect=${encodeURIComponent(url.searchParams.get('redirect')!)}`;

View File

@@ -1,7 +1,8 @@
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
// Alias for /login/alternative/code?code=...
export function GET({ url, params }) {
export const load: PageLoad = async ({ url, params }) => {
const targetPath = '/login/alternative/code';
const searchParams = new URLSearchParams();