Solves #7
Added token boolean property to module options, to switch between sanctum cookie-based to jwt-based auth (a-là mobile app frontend). See laravel docs
With jwt mode:
At login time, the plugin expects a json response from laravel backend containing the token generated (guide)
Once token is received, it is saved in a cookie
A global middleware that runs for every route obtains the cookie token and fetches again the user (if app store is empty, just like the standard mode)
The token is added in the headers of every request made using apiFetch function (again, just like the standard mode)
Configuration and steps needed are in readme file.
Solves #7 Added
token
boolean property to module options, to switch between sanctum cookie-based to jwt-based auth (a-là mobile app frontend). See laravel docsWith jwt mode:
apiFetch
function (again, just like the standard mode)Configuration and steps needed are in readme file.