File tree Expand file tree Collapse file tree 5 files changed +35
-19
lines changed Expand file tree Collapse file tree 5 files changed +35
-19
lines changed Original file line number Diff line number Diff line change @@ -42,22 +42,22 @@ const nextConfig = {
42
42
{
43
43
source : "/(.*)" ,
44
44
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
+ } ,
61
61
{
62
62
key : "Permissions-Policy" ,
63
63
value :
Original file line number Diff line number Diff line change
1
+ "use client" ;
2
+
1
3
import { AuthTypeMetadata } from "@/lib/userSS" ;
2
4
import { LoginText } from "./LoginText" ;
3
5
import Link from "next/link" ;
4
6
import { SignInButton } from "./SignInButton" ;
5
7
import { EmailPasswordForm } from "./EmailPasswordForm" ;
6
8
import { NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED } from "@/lib/constants" ;
7
9
import Title from "@/components/ui/title" ;
10
+ import { useSendAuthRequiredMessage } from "@/lib/extension/utils" ;
8
11
9
12
export default function LoginPage ( {
10
13
authUrl,
@@ -23,6 +26,7 @@ export default function LoginPage({
23
26
| undefined ;
24
27
showPageRedirect ?: boolean ;
25
28
} ) {
29
+ useSendAuthRequiredMessage ( ) ;
26
30
return (
27
31
< div className = "flex flex-col w-full justify-center" >
28
32
{ authUrl && authTypeMetadata && (
@@ -86,9 +90,9 @@ export default function LoginPage({
86
90
< span
87
91
onClick = { ( ) => {
88
92
if ( typeof window !== "undefined" && window . top ) {
89
- window . top . location . href = "/auth/register " ;
93
+ window . top . location . href = "/auth/signup " ;
90
94
} else {
91
- window . location . href = "/auth/register " ;
95
+ window . location . href = "/auth/signup " ;
92
96
}
93
97
} }
94
98
className = "text-link font-medium cursor-pointer"
Original file line number Diff line number Diff line change 7
7
AuthTypeMetadata ,
8
8
} from "@/lib/userSS" ;
9
9
import { redirect } from "next/navigation" ;
10
- import { getSecondsUntilExpiration } from "@/lib/time" ;
11
10
import AuthFlowContainer from "@/components/auth/AuthFlowContainer" ;
12
11
import LoginPage from "./LoginPage" ;
13
12
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export const CHROME_MESSAGE = {
16
16
SET_DEFAULT_NEW_TAB : "SET_DEFAULT_NEW_TAB" ,
17
17
LOAD_NEW_CHAT_PAGE : "LOAD_NEW_CHAT_PAGE" ,
18
18
LOAD_NEW_PAGE : "LOAD_NEW_PAGE" ,
19
+ AUTH_REQUIRED : "AUTH_REQUIRED" ,
19
20
} ;
20
21
21
22
export const SUBMIT_MESSAGE_TYPES = {
Original file line number Diff line number Diff line change @@ -9,6 +9,18 @@ export function sendSetDefaultNewTabMessage(value: boolean) {
9
9
}
10
10
}
11
11
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
+
12
24
export const sendMessageToParent = ( ) => {
13
25
if ( typeof window !== "undefined" && window . parent ) {
14
26
window . parent . postMessage ( { type : CHROME_MESSAGE . ONYX_APP_LOADED } , "*" ) ;
You can’t perform that action at this time.
0 commit comments