I'm using Fortify in my Laravel 8 application that's used as an API backend to a Nuxt front-end. When a user logs in, and their log in is successful; I'd like to perform some custom functionality to update things in my database after a user logs in, how can I achieve this?
Originally posted here and suggested to use Stackoverflow
You could write a custom user authentication inside the
FortifyServiceProvider
file'sboot
function.So for an example, you can do this:
So this would execute and run your custom functionality BEFORE the user gets logged in, but since you're checking beforehand if everything is in order with the provided login credentials, you can do what you need.
Hope this helps.