File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed
Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 3030 if [ -d "$function" ]; then
3131 function_name=$(basename "$function")
3232 echo "Deploying function: $function_name"
33- npx supabase functions deploy "$function_name" --project-ref ${{ secrets.SUPABASE_PROJECT_REF }}
34- fi
35- done
36-
37- - name : Disable JWT Authentication for Functions
38- run : |
39- for function in supabase/functions/*; do
40- if [ -d "$function" ]; then
41- function_name=$(basename "$function")
42- curl -X PUT "https://api.supabase.io/v1/projects/${{ secrets.SUPABASE_PROJECT_REF }}/functions/$function_name" \
43- -H "Authorization: Bearer ${{ secrets.SUPABASE_ACCESS_TOKEN }}" \
44- -d '{"jwt": false}'
33+ npx supabase functions deploy "$function_name" --project-ref ${{ secrets.SUPABASE_PROJECT_REF }} --disable-jwt
4534 fi
4635 done
4736
Original file line number Diff line number Diff line change 2424 document . addEventListener ( "DOMContentLoaded" , async ( ) => {
2525 const { data, error } = await supabase . auth . getUser ( ) ;
2626
27- /* if (!data.user) {
27+ if ( ! data . user ) {
2828 window . location . href = "/u/login.html" ;
2929 return ;
3030 } else if ( error ) {
3131 console . error ( error ) ;
32- }*/
32+ }
33+
34+ const data = {
35+ user_id : userId
36+ } ;
37+
38+ fetch ( 'https://jwpvozanqtemykhdqhvk.supabase.co/functions/v1/inituser' , {
39+ method : 'POST' ,
40+ headers : {
41+ 'Content-Type' : 'application/json' ,
42+ } ,
43+ body : JSON . stringify ( data )
44+ } )
45+ . then ( response => response . json ( ) )
46+ . then ( data => {
47+ console . log ( 'Function response:' , data ) ;
48+ } )
49+ . catch ( ( error ) => {
50+ console . error ( 'Error invoking function:' , error ) ;
51+ } ) ;
3352 } ) ;
3453
3554 initFooter ( ) ;
You can’t perform that action at this time.
0 commit comments