If you have any questions feel free to comment on this post. Providers Table), and link each user registered by Laravel Socialite to this table and record the user Provider and other details, and do not forget your own touch. In the end, I hope this article is useful and helpful to you,And remember that this is just a very simple form of the code so that the article is not too long, so try to add what you need (for example Laravel is a PHP web application framework with expressive, elegant syntax. You can get the source code for this project from github Permission may only be granted subject to certain conditions and these may include the requirement that you enter into an agreement with us to maintain the quality of the product and/or service which you intend to supply at a prescribed level. You can see all user info given by google token by dd the $providerUser in SocialiteController: You may now be wondering how to get access_provider_token, well I'm using a Flutter application created by my friend Fadi Asfour to get this tokens. Now that we've finished the code, let's go to postman and test our routes : Normally, to authenticate with the laravel api using sanctum. Only ( 'name', 'email', 'password', 'password_confirmation' ),, 'email' =>, 'password' =>, ]) if ( $validator -> fails ()) return response () -> json ( $validator -> errors (), 400 ) $input = $request -> only ( 'name', 'email', 'password' ) $input = Hash :: make ( $request ) $user = User :: create ( $input ) $data = return response () -> json ( $data, 200 ) } public function login ( Request $request ) Įnter fullscreen mode Exit fullscreen mode I have a Vue SPA for my front end and a Laravel app as a backend api (they run on the same domain).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |