E
E
Emil Rakhmatullin2020-07-01 17:51:23
In contact with
Emil Rakhmatullin, 2020-07-01 17:51:23

How to make authorization through VK in Laravel?

I know about SocialLite Providers and Laravel SocialLite .

But the details of the type are not written anywhere: what to add to the user database, how to authorize the user if he has already been added to the database, and so on ...

How next? Already getting a user who wants to log in

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jazzus, 2020-07-01
@Emchik

Yes, they write a lot. For example, in the next branch ) There are no providers in the description. These questions do not apply to social authorization. If the user has received - to search for these data of the user in a DB. If not found then create a user. These are the questions of working with Laravel models. I also made a separate table for social networks where the provider_user_id is indicated with a hasMany connection with the user. a user can have many social networks and not have an email. In short, it depends on the logic of the application. Authorize user like this
auth()->login($user);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question