title: Laravel 8: Using Fortify in APIs
body: <p>Can Laravel Fortify be used in the context of API? From what I understand, Fortify (although being headless, i.e. doesn't include a UI layer) allows us to customize Login and Register pages, but it automatically redirects to HOME page upon successful authentication. And although the HOME page is customizable, that is not how API logins normally work. It should simply return a success token in JSON format without redirects of any kind.</p>
  <p>There is an <code>authenticateUsing</code> function in Fortify, but even that simply allows us to customize authentication logic and not the returned data. Redirection is still performed by Fortify.</p>
  <p>How can I use Fortify in the context of REST API?</p>
  <p>Note: I'm going to use it from my Vue front-end application. I'm also going to get <strong>Sanctum</strong> into the game, but before that I just wanted to see if I can do regular token-based authentication using Fortify without having to write my own login, register and logout routes and controller functions.</p>