Prefer mobile auth cookie for app requests
This commit is contained in:
@@ -28,8 +28,6 @@ function looksLikeSessionCookie(cookie: string): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function headersWithAuthCookieFallback(headers: Headers): Headers {
|
export function headersWithAuthCookieFallback(headers: Headers): Headers {
|
||||||
if (headers.get("cookie")?.trim()) return headers;
|
|
||||||
|
|
||||||
const mobileCookie = headers.get(MOBILE_AUTH_COOKIE_HEADER)?.trim();
|
const mobileCookie = headers.get(MOBILE_AUTH_COOKIE_HEADER)?.trim();
|
||||||
if (
|
if (
|
||||||
mobileCookie &&
|
mobileCookie &&
|
||||||
@@ -41,6 +39,8 @@ export function headersWithAuthCookieFallback(headers: Headers): Headers {
|
|||||||
return nextHeaders;
|
return nextHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headers.get("cookie")?.trim()) return headers;
|
||||||
|
|
||||||
const sessionToken = headers.get(MOBILE_SESSION_TOKEN_HEADER)?.trim();
|
const sessionToken = headers.get(MOBILE_SESSION_TOKEN_HEADER)?.trim();
|
||||||
if (
|
if (
|
||||||
sessionToken &&
|
sessionToken &&
|
||||||
|
|||||||
Reference in New Issue
Block a user