Learn how to implement social authentication in the Larafast API Boilerplate.
SocialiteController
class.
redirect
method in the SocialiteController
class is used to redirect the user to the OAuth provider. The method accepts a driver
parameter which specifies the OAuth provider to use.
callback
method in the SocialiteController
class is used to handle the callback from the OAuth provider. It retrieves the user details from the provider and creates or retrieves the corresponding user record in the application’s database.
routes/auth.php
file. The routes use the SocialiteController
class, and the redirect
and callback
methods respectively. These routes are grouped under a middleware that ensures only guest users can access them.