Fix secure cookies bug
This commit is contained in:
@@ -72,6 +72,9 @@ export const handler: BunextAPIRouteHandler<APIResponseObject> = async (
|
||||
if (reauth) {
|
||||
return await loginUser({
|
||||
user_id: Number(user_id),
|
||||
secure:
|
||||
req.headers.get("x-forwarded-proto") === "https" ||
|
||||
req.url.startsWith("https:"),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
|
||||
export const handler: BunextAPIRouteHandler<APIResponseObject> = async ({
|
||||
body,
|
||||
req,
|
||||
}) => {
|
||||
try {
|
||||
const { login } = body as ApiReqParams;
|
||||
@@ -65,6 +66,9 @@ export const handler: BunextAPIRouteHandler<APIResponseObject> = async ({
|
||||
|
||||
return await loginUser({
|
||||
user_id: target_user.id,
|
||||
secure:
|
||||
req.headers.get("x-forwarded-proto") === "https" ||
|
||||
req.url.startsWith("https:"),
|
||||
});
|
||||
} catch (error: any) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user