Skip to content

Commit b6f36ce

Browse files
committed
Use https in production even if behind a proxy.
1 parent fe41515 commit b6f36ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

webserver/src/layouts/Layout.astro

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const { title, user, needLogin = false } = Astro.props;
1616
const login_uri = new URL(
1717
`/finish_login?from=${encodeURIComponent(Astro.url.href)}`,
1818
Astro.url
19-
).href;
19+
);
20+
if (login_uri.hostname !== "localhost") {
21+
login_uri.protocol = "https";
22+
}
2023
---
2124

2225
<!DOCTYPE html>
@@ -68,7 +71,7 @@ const login_uri = new URL(
6871
data-context="signin"
6972
data-ux_mode="popup"
7073
data-auto_prompt={String(needLogin)}
71-
data-login_uri={login_uri}
74+
data-login_uri={login_uri.href}
7275
data-itp_support="true"
7376
/>
7477
<div

0 commit comments

Comments
 (0)