fix: correctly redirect back after login
This commit is contained in:
@@ -39,7 +39,8 @@ export default async function AdminLayout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
if (!(await adminCheck())) redirect("/login");
|
||||
if (!(await adminCheck()))
|
||||
redirect(`/login?next=${encodeURIComponent("/artifact/admin")}`);
|
||||
const subs = await db
|
||||
.select({
|
||||
id: submissions.id,
|
||||
|
||||
@@ -6,7 +6,8 @@ import { adminCheck } from "@/lib/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function () {
|
||||
if (!(await adminCheck())) redirect("/login");
|
||||
if (!(await adminCheck()))
|
||||
redirect(`/login?next=${encodeURIComponent("/donate/admin")}`);
|
||||
|
||||
const data = await db
|
||||
.select()
|
||||
|
||||
@@ -41,7 +41,8 @@ export default async function AdminLayout({
|
||||
children: React.ReactNode;
|
||||
modal: React.ReactNode;
|
||||
}) {
|
||||
if (!(await adminCheck())) redirect("/login");
|
||||
if (!(await adminCheck()))
|
||||
redirect(`/login?next=${encodeURIComponent("/rubgram/admin")}`);
|
||||
const subs = await db
|
||||
.select({
|
||||
id: endgameSubmissions.id,
|
||||
|
||||
Reference in New Issue
Block a user