File tree Expand file tree Collapse file tree 6 files changed +13
-8
lines changed
lib/components/ui/editor/components Expand file tree Collapse file tree 6 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 7171 }
7272 } else {
7373 if (onNewline ) {
74- console .log (' onnew line!' );
7574 readyToLoseFocusBecauseNewLineIsCalled = true ;
76- console .log (searchValue );
7775 onNewline ();
7876 }
7977 }
Original file line number Diff line number Diff line change 9696 closeCreateSpecDialog ();
9797 }
9898 } else {
99+ // TODO
99100 console .log (' please login!' );
100101 }
101102 }
120121 }
121122 return ;
122123 } else {
124+ // TODO!
123125 console .log (' please login!' );
124126 }
125127 }
Original file line number Diff line number Diff line change 77 import demoImg from ' $lib/assets/1.png' ;
88 import codeDemoImg from ' $lib/assets/2.png' ;
99 import exportImg from ' $lib/assets/3.png' ;
10+ import { onMount } from ' svelte' ;
11+
12+ onMount (() => {});
1013
1114 const plans = [
1215 {
Original file line number Diff line number Diff line change 77 let { data } = $props ();
88
99 onMount (() => {
10- console .log (data );
1110 if (data .authState != null ) {
1211 window .location .href = ' /' ;
1312 }
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { google } from "$lib/server/services/application/authService";
33import type { RequestEvent } from "@sveltejs/kit" ;
44
55export async function GET ( event : RequestEvent ) : Promise < Response > {
6- console . log ( event . url . searchParams ) ;
76 const postLoginPath = event . url . searchParams . get ( "postLoginPath" ) ?? "" ;
87
98 const state = generateState ( ) ;
Original file line number Diff line number Diff line change @@ -7,10 +7,8 @@ import * as subService from "$lib/server/services/application/subscriptionServic
77export async function POST (
88 { request } : RequestEvent ,
99) : Promise < Response > {
10- const body = await request . json ( ) ;
11-
12- let event = body ;
1310 const endpointSecret = STRIPE_WEBHOOK_SECRET ;
11+ let event : Stripe . Event | null = null ;
1412 const signature = request . headers . get ( "stripe-signature" ) ;
1513 if ( ! signature ) {
1614 return new Response ( JSON . stringify ( { error : "bad request" } ) , {
@@ -19,10 +17,15 @@ export async function POST(
1917 }
2018 try {
2119 event = stripeClient . webhooks . constructEvent (
22- body ,
20+ await request . text ( ) ,
2321 signature ,
2422 endpointSecret ,
2523 ) ;
24+ if ( event === null ) {
25+ return new Response ( JSON . stringify ( { error : "bad request" } ) , {
26+ status : 400 ,
27+ } ) ;
28+ }
2629 } catch ( _err ) {
2730 return new Response ( JSON . stringify ( { error : "bad request" } ) , {
2831 status : 400 ,
@@ -34,6 +37,7 @@ export async function POST(
3437 let customerId = "" ;
3538 let subscriptionId = "" ;
3639 let yizyUserId = "" ;
40+
3741 switch ( event . type ) {
3842 case "checkout.session.completed" :
3943 checkoutSession = event . data . object ;
You can’t perform that action at this time.
0 commit comments