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) {
|
||||
return new Response(null, {
|
||||
headers: {
|
||||
location: "/api/auth/oauth",
|
||||
location: "/api/auth/oauth?type=mobile",
|
||||
},
|
||||
status: 302,
|
||||
});
|
||||
|
@ -5,6 +5,12 @@ export async function onRequestGet(context: RequestContext) {
|
||||
const referer = request.headers.get("referer");
|
||||
|
||||
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("-", "");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user