This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { nextTick } from 'vue' | |
export const useProperCookie = () => useCookie('proper_token') | |
export const useAuthFetch = (url, fetchOptions = {}) => { | |
return $fetch(url, { | |
baseURL: 'https://l9.test/api/v1', | |
...fetchOptions, | |
headers: { | |
Authorization: `Bearer ${useProperCookie().value}`, | |
...fetchOptions.headers, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# By @andregarcia013 from https://github.com/fruitcake/laravel-cors/issues/471#issuecomment-651505665 | |
namespace App\Http\Middleware; | |
use Closure; | |
class CORS | |
{ |