Add query param because of some browsers not sending the referrer

This commit is contained in:
2023-10-19 16:51:09 -04:00
parent 9bb2d7396d
commit c7d1e4bd53
2 changed files with 7 additions and 1 deletions

View File

@ -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("-", "");