forked from administration/panel
fix: use callback url if present
parent
2c3ad1082e
commit
68851f1b17
|
@ -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
|
||||
|
|
|
@ -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 (
|
||||
<>
|
||||
<Button variant="outline" onClick={() => signIn("authentik")}>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() =>
|
||||
signIn("authentik", {
|
||||
callbackUrl: params.get("callbackUrl") ?? undefined,
|
||||
})
|
||||
}
|
||||
>
|
||||
login with revolt sso
|
||||
</Button>
|
||||
<img
|
||||
|
|
Loading…
Reference in New Issue