tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
27
pulls
pipelines
use window.href to redirect in oauth error
awarm.space
2 months ago
125a65cc
ee8333d1
+1
-3
1 changed file
expand all
collapse all
unified
split
components
OAuthError.tsx
+1
-3
components/OAuthError.tsx
···
1
1
"use client";
2
2
3
3
import { OAuthSessionError } from "src/atproto-oauth";
4
4
-
import { usePathname } from "next/navigation";
5
4
6
5
export function OAuthErrorMessage({
7
6
error,
···
10
9
error: OAuthSessionError;
11
10
className?: string;
12
11
}) {
13
13
-
const pathname = usePathname();
14
14
-
const signInUrl = `/api/oauth/login?redirect_url=${encodeURIComponent(pathname)}${error.did ? `&handle=${encodeURIComponent(error.did)}` : ""}`;
12
12
+
const signInUrl = `/api/oauth/login?redirect_url=${encodeURIComponent(window.location.href)}${error.did ? `&handle=${encodeURIComponent(error.did)}` : ""}`;
15
13
16
14
return (
17
15
<div className={className}>