Browse Source

Update APIV1Controller, fix cors bug

Daniel Supernault 5 years ago
parent
commit
55ee29f301
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/Http/Controllers/Api/ApiV1Controller.php

+ 4 - 2
app/Http/Controllers/Api/ApiV1Controller.php

@@ -86,7 +86,9 @@ class ApiV1Controller extends Controller
         	'client_secret' => $client->secret,
         	'vapid_key' => null
         ];
-        return $res;
+        return response()->json($res, 200, [
+            'Access-Control-Allow-Origin' => '*'
+        ]);
 	}
 
     /**
@@ -241,7 +243,7 @@ class ApiV1Controller extends Controller
                 $res = [];
             }
         }
-        
+
         return response()->json($res);
     }