tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
291
fork
atom
a tool for shared writing and social publishing
291
fork
atom
overview
issues
27
pulls
pipelines
fix handling oauth redirects to specifc subdomain
awarm.space
6 months ago
24e51797
294ca6d5
+5
-2
1 changed file
expand all
collapse all
unified
split
app
api
oauth
[route]
route.ts
+5
-2
app/api/oauth/[route]/route.ts
···
116
116
action: ActionAfterSignIn | null,
117
117
redirectPath: string,
118
118
) => {
119
119
-
let url = new URL(decodeURIComponent(redirectPath), "https://example.com");
119
119
+
let parsePath = decodeURIComponent(redirectPath);
120
120
+
let url;
121
121
+
if (parsePath.includes("://")) url = new URL(parsePath);
122
122
+
else url = new URL(decodeURIComponent(redirectPath), "https://example.com");
120
123
if (action?.action === "subscribe") {
121
124
let result = await subscribeToPublication(action.publication);
122
125
console.log(result);
···
127
130
let path = url.pathname;
128
131
if (url.search) path += url.search;
129
132
if (url.hash) path += url.hash;
130
130
-
return redirect(path);
133
133
+
return parsePath.includes("://") ? redirect(url.toString()) : redirect(path);
131
134
};