Closed mst101 closed 6 years ago
Thank you. It's more understandable now that you've updated the example. Maybe you could include the migration as part of your package?
A couple of other minor tweaks:
The loginFacebook method should have an arrow, not a colon: return response()->json(["error" => $e->getMessage() ]);
The issueToken method needs to accept the $request parameter.
I still need to get my head round all this, but it looks promising...
Hi, thanks for pointing out the mistakes in readme! I have updated it.
The reason why I haven't added the migration (i.e. social_accounts table) to the package is, the developer should have the flexibility to choose what to store and what not to from 3rd party provider. to facilitate that their's an interface Anand\Laravel\PassportSocialite\User\UserSocialAccount
provided which must be implemented on user model and then a function findForPassportSocialite
is added to it which returns the user object using the provided input i.e. provider and id, if it satisfies the developer's conditions or else null to the package and then package generates or refuses the request to generate access token.
Peace, Anand Siddharth
If you are asking
SocialAccount
which is in the example it's a laravel model i.e. database table. from where I am querying if the user id exists with a certain 3rd party oauth provider i.e. facebook. It's clearly understandable from the example since it haswhere
methods called. Hope this answers your question.Peace, Anand Siddharth