i add the default authentification to my project using Laravel ui ,
and next i add laravel passport for api , so we need to create login and registre function ?
or how we can use login and function offred by laravel ui in this case ?
so we need to create login and registre function ?
Yes. Laravel UI's login and register routes are meant to be used with session-based request and not from API.
Also, if your app does not need to serve as an OAuth server for other apps (similar to when you use "Login With Facebook", but in this case your app would play the Facebook roles on authorizing third-party apps), I highly recommend you using Laravel Sanctum instead of Laravel Passport.
@jokerdz Passport adds OAuth authentication to your application, so it allows first- and third-party clients to request tokens for your users, which you can then use to make API requests as that user. You don’t “log in” to an API; you use tokens to authenticate each request.
For registration, if you want to be able to register users from a first- or third-party client, then you’ll need to create an API endpoint that facilitates this. Be sure to add spam prevention measures to this endpoint though, such as rate limiting, reCAPTCHA for repeated registrations from the same device/location, etc.
@jokerdz First party clients are things like your own mobile apps. Third party clients are exactly that: third parties that need to access your data for some reason.
Think about Facebook. When you authenticate with Facebook to get a user’s details, you do so as a third party. You don’t work for Facebook, but you’re using OAuth to retrieve data from Facebook’s servers. Whereas the Messenger app would be a first party client to Facebook, because Facebook owns and operates Messenger and its apps.