aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/start/+server.ts
blob: 2d1319eca33463346d9341785be89b1deeb23c4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { redirect } from "@sveltejs/kit";

export async function GET({ cookies }) {
  const pathname = cookies.get("pathname");
  const username = cookies.get("username");
  if (username) {
    if (pathname) redirect(307, pathname);
    else redirect(307, `/${username}`);
  }

  redirect(307, "/");
}