Add query param because of some browsers not sending the referrer
This commit is contained in:
@ -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("-", "");
|
||||
|
||||
|
Reference in New Issue
Block a user