验证电子邮件时将用户重定向到自定义页面

I was following a post on medium on how to do API email verification in Laravel 5.8 here https://medium.com/@pran.81/how-to-implement-laravels-must-verify-email-feature-in-the-api-registration-b531608ecb99

I tested it and it works perfectly but I was wondering how it would work when a web or mobile application consumes the API. Here are my thoughts

  1. Web or mobile user registers a new account by calling the route Route::post('register', 'AuthController@register') and the controller register method is this
public function register(Request $request)
{
    // validate inputs

    // store new user & send verify email notification to user
    $user = User::create([
        'firstname' => $request->firstname,
        'lastname'  => $request->lastname,
        'username'  => $request->username,
        'password'  => bcrypt($request->password)
    ]);

    $user->sendApiEmailVerificationNotification();

    // assign access token to newly registered user

    // return access token & user data

}
  1. User get an email with a Verify Email Address button

Now what should happen next? Should the user be redirected to the web app login page? If yes, how do I customise the redirect url? At the moment when I click on the verify email address button, a browser opens up and I get all the response on the browser page like this api endpoint response

Once the user clicks on Verify they are redirected to the path mentioned in

App\Http\Controllers\Auth\VerificationController

Now if you want to change the redirect after verification you can change the below line of code with your route in VerificationController

/** * Where to redirect users after verification. * * @var string */ protected $redirectTo = '/home';