@wtfalch/auth 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.js +6 -1
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -135,7 +135,12 @@ export function createAuth(input) {
|
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
137
|
const callback = async (request) => {
|
|
138
|
-
|
|
138
|
+
// Behind a proxy the request can arrive as http:// or on an internal host,
|
|
139
|
+
// and `validCallback` would refuse it. The browser reached this app, so the
|
|
140
|
+
// path and query are what it asked for, on the app's own origin.
|
|
141
|
+
const { pathname, search } = new URL(request.url);
|
|
142
|
+
const callbackUrl = new URL(`${pathname}${search}`, options().appUrl).href;
|
|
143
|
+
const { location, cookies } = await complete(callbackUrl, request.headers.get('cookie'));
|
|
139
144
|
return redirect(location, cookies);
|
|
140
145
|
};
|
|
141
146
|
const logout = async (request) => {
|
package/package.json
CHANGED