File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-firebase-project-id
55NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET = your-firebase-storage-bucket
66NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID = your-firebase-messaging-sender-id
77NEXT_PUBLIC_FIREBASE_APP_ID = your-firebase-app-id
8+ NEXT_PUBLIC_FIREBASE_APP_CHECK_KEY = your-firebase-app-check-site-key
89
910# LINE LIFF Config
1011NEXT_PUBLIC_LINE_LIFF_ID = your-line-liff-id
Original file line number Diff line number Diff line change 4141 NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET : ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
4242 NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID : ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
4343 NEXT_PUBLIC_FIREBASE_APP_ID : ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
44+ NEXT_PUBLIC_FIREBASE_APP_CHECK_KEY : ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_CHECK_KEY }}
4445 NEXT_PUBLIC_LINE_LIFF_ID : ${{ secrets.NEXT_PUBLIC_LINE_LIFF_ID }}
4546
4647 - uses : FirebaseExtended/action-hosting-deploy@v0.9.0
Original file line number Diff line number Diff line change 1+ "use client" ;
2+ import Link from "next/link" ;
3+
4+ export default function NotFound ( ) {
5+ return (
6+ < div >
7+ < h2 > Not Found</ h2 >
8+ < p > Could not find requested resource</ p >
9+ < Link href = "/" > Return Home</ Link >
10+ </ div >
11+ ) ;
12+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414 DocumentData ,
1515} from "firebase/firestore" ;
1616import { getFunctions , httpsCallable } from "firebase/functions" ;
17+ import { initializeAppCheck , ReCaptchaV3Provider } from "firebase/app-check" ;
1718import type {
1819 AuthenticateLineUserParams ,
1920 AuthenticateLineUserResult ,
@@ -32,6 +33,19 @@ const firebaseConfig = {
3233// Initialize Firebase
3334const app =
3435 getApps ( ) . length === 0 ? initializeApp ( firebaseConfig ) : getApps ( ) [ 0 ] ;
36+
37+ if ( process . env . NEXT_PUBLIC_FIREBASE_APP_CHECK_KEY ) {
38+ initializeAppCheck ( app , {
39+ provider : new ReCaptchaV3Provider (
40+ process . env . NEXT_PUBLIC_FIREBASE_APP_CHECK_KEY
41+ ) ,
42+
43+ // Optional argument. If true, the SDK automatically refreshes App Check
44+ // tokens as needed.
45+ isTokenAutoRefreshEnabled : true ,
46+ } ) ;
47+ }
48+
3549const auth = getAuth ( app ) ;
3650const db = getFirestore ( app ) ;
3751const functions = getFunctions ( app , "asia-southeast1" ) ;
You can’t perform that action at this time.
0 commit comments