Add query param because of some browsers not sending the referrer
This commit is contained in:
parent
9bb2d7396d
commit
c7d1e4bd53
@ -1,7 +1,7 @@
|
|||||||
export async function onRequestGet(_context: RequestContext) {
|
export async function onRequestGet(_context: RequestContext) {
|
||||||
return new Response(null, {
|
return new Response(null, {
|
||||||
headers: {
|
headers: {
|
||||||
location: "/api/auth/oauth",
|
location: "/api/auth/oauth?type=mobile",
|
||||||
},
|
},
|
||||||
status: 302,
|
status: 302,
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,12 @@ export async function onRequestGet(context: RequestContext) {
|
|||||||
const referer = request.headers.get("referer");
|
const referer = request.headers.get("referer");
|
||||||
|
|
||||||
if (referer) returnPath = new URL(referer).pathname;
|
if (referer) returnPath = new URL(referer).pathname;
|
||||||
|
else {
|
||||||
|
const { searchParams } = new URL(context.request.url);
|
||||||
|
|
||||||
|
if (searchParams.get("type") === "mobile")
|
||||||
|
returnPath = "/api/auth/mobile/token";
|
||||||
|
}
|
||||||
|
|
||||||
const state = crypto.randomUUID().replaceAll("-", "");
|
const state = crypto.randomUUID().replaceAll("-", "");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user