From 68851f1b170d8d56cf905ad97332cb1520defde2 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sun, 30 Jul 2023 12:14:09 +0100 Subject: [PATCH] fix: use callback url if present --- app/api/auth/[...nextauth]/route.ts | 1 - components/pages/home/LoginButton.tsx | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 4c55320..ca0b5b4 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -4,4 +4,3 @@ import NextAuth from "next-auth"; const handler = NextAuth(authOptions); export { handler as GET, handler as POST }; -// admin.revolt.chat/panel/this/should/redirect/any/path diff --git a/components/pages/home/LoginButton.tsx b/components/pages/home/LoginButton.tsx index 6dc620c..1bcdee3 100644 --- a/components/pages/home/LoginButton.tsx +++ b/components/pages/home/LoginButton.tsx @@ -6,6 +6,7 @@ import Link from "next/link"; export function LoginButton() { const { data: session } = useSession(); + const params = new URLSearchParams(document.location.search); if (session) { return ( @@ -26,7 +27,14 @@ export function LoginButton() { return ( <> -