You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Sanctum for a first-party SPA. The documentation ("Protecting Routes") suggests configuring the API routes with middleware('auth:sanctum'). I try instead changing the 'api' auth guard driver to 'sanctum' (in config/auth.php):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using Sanctum for a first-party SPA. The documentation ("Protecting Routes") suggests configuring the API routes with
middleware('auth:sanctum')
. I try instead changing the 'api' auth guard driver to 'sanctum' (in config/auth.php):The allows me to use the usual
middleware('auth:api')
for my routes. It seems to work, but I wonder if there may be issue with this approach.Beta Was this translation helpful? Give feedback.
All reactions