Svelte and SvelteKit 5 · SvelteKit

Redirect

Redirect from server code, for example when the user isn't signed in.

import { redirect } from "@sveltejs/kit";

throw redirect(303, "/login");

Official Svelte and SvelteKit 5 documentation

More sveltekit commands

All sveltekit commands · Svelte and SvelteKit 5 cheatsheet

Was this page helpful?