tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.32k stars 1.54k forks source link

Examples for unmentioned routes (like Email Verification) #2236

Open saleh-mir opened 11 months ago

saleh-mir commented 11 months ago

Subject of the issue

I want to use Laravel as an API (on api.xxx.com) only for my website, which has a SPA frontend (on xxx.com). That's why I'm using this package for authentication.

The problem I have is with the implementation of routes that haven't been mentioned in your documentation. For example, email verification. Are there any examples of that? Because the official Laravel website always assumes that you are using Laravel for displaying your views and isn't really meant for using it as an API.

Your environment

Q A
Bug? no
New Feature? yes (kinda)
Framework Laravel
Framework version 10
Package version 2
PHP version 8.1
eznix86 commented 9 months ago

It is mentionned for api.

You need to use the auth('api')