Skip to content

Commit cafa0aa

Browse files
committed
push minor changes
1 parent f61864c commit cafa0aa

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

web/next.config.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ const nextConfig = {
4242
{
4343
source: "/(.*)",
4444
headers: [
45-
// {
46-
// key: "Content-Security-Policy",
47-
// value: cspHeader.replace(/\n/g, ""),
48-
// },
49-
// {
50-
// key: "Strict-Transport-Security",
51-
// value: "max-age=63072000; includeSubDomains; preload",
52-
// },
53-
// {
54-
// key: "Referrer-Policy",
55-
// value: "strict-origin-when-cross-origin",
56-
// },
57-
// {
58-
// key: "X-Content-Type-Options",
59-
// value: "nosniff",
60-
// },
45+
{
46+
key: "Content-Security-Policy",
47+
value: cspHeader.replace(/\n/g, ""),
48+
},
49+
{
50+
key: "Strict-Transport-Security",
51+
value: "max-age=63072000; includeSubDomains; preload",
52+
},
53+
{
54+
key: "Referrer-Policy",
55+
value: "strict-origin-when-cross-origin",
56+
},
57+
{
58+
key: "X-Content-Type-Options",
59+
value: "nosniff",
60+
},
6161
{
6262
key: "Permissions-Policy",
6363
value:

web/src/app/auth/login/LoginPage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
"use client";
2+
13
import { AuthTypeMetadata } from "@/lib/userSS";
24
import { LoginText } from "./LoginText";
35
import Link from "next/link";
46
import { SignInButton } from "./SignInButton";
57
import { EmailPasswordForm } from "./EmailPasswordForm";
68
import { NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED } from "@/lib/constants";
79
import Title from "@/components/ui/title";
10+
import { useSendAuthRequiredMessage } from "@/lib/extension/utils";
811

912
export default function LoginPage({
1013
authUrl,
@@ -23,6 +26,7 @@ export default function LoginPage({
2326
| undefined;
2427
showPageRedirect?: boolean;
2528
}) {
29+
useSendAuthRequiredMessage();
2630
return (
2731
<div className="flex flex-col w-full justify-center">
2832
{authUrl && authTypeMetadata && (
@@ -86,9 +90,9 @@ export default function LoginPage({
8690
<span
8791
onClick={() => {
8892
if (typeof window !== "undefined" && window.top) {
89-
window.top.location.href = "/auth/register";
93+
window.top.location.href = "/auth/signup";
9094
} else {
91-
window.location.href = "/auth/register";
95+
window.location.href = "/auth/signup";
9296
}
9397
}}
9498
className="text-link font-medium cursor-pointer"

web/src/app/auth/login/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
AuthTypeMetadata,
88
} from "@/lib/userSS";
99
import { redirect } from "next/navigation";
10-
import { getSecondsUntilExpiration } from "@/lib/time";
1110
import AuthFlowContainer from "@/components/auth/AuthFlowContainer";
1211
import LoginPage from "./LoginPage";
1312

web/src/lib/extension/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const CHROME_MESSAGE = {
1616
SET_DEFAULT_NEW_TAB: "SET_DEFAULT_NEW_TAB",
1717
LOAD_NEW_CHAT_PAGE: "LOAD_NEW_CHAT_PAGE",
1818
LOAD_NEW_PAGE: "LOAD_NEW_PAGE",
19+
AUTH_REQUIRED: "AUTH_REQUIRED",
1920
};
2021

2122
export const SUBMIT_MESSAGE_TYPES = {

web/src/lib/extension/utils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ export function sendSetDefaultNewTabMessage(value: boolean) {
99
}
1010
}
1111

12+
export const sendAuthRequiredMessage = () => {
13+
if (typeof window !== "undefined" && window.parent) {
14+
window.parent.postMessage({ type: CHROME_MESSAGE.AUTH_REQUIRED }, "*");
15+
}
16+
};
17+
18+
export const useSendAuthRequiredMessage = () => {
19+
useEffect(() => {
20+
sendAuthRequiredMessage();
21+
}, []);
22+
};
23+
1224
export const sendMessageToParent = () => {
1325
if (typeof window !== "undefined" && window.parent) {
1426
window.parent.postMessage({ type: CHROME_MESSAGE.ONYX_APP_LOADED }, "*");

0 commit comments

Comments
 (0)