R
R
Ruslan Absalyamov2018-09-29 15:21:52
Laravel
Ruslan Absalyamov, 2018-09-29 15:21:52

How do I usually implement api registration on laravel?

I want to make frontend spa a vue app and backend laravel. It's just not clear yet, let's say standard registration creates a user, but for some reason does not authorize him. According to the article https://solutionfactor.net/blog/2017/11/20/laravel...

Route::group(['middleware' => ['api','cors']], function () {
    Route::post('auth/register', 'Auth\[email protected]');
});

Do I have to group routes and assign middleware to them or not?
Just an approximate implementation, I don’t understand how to do it in laravel

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Krivosheev, 2018-09-29
@Nemozar

Read about jwt authorization. There are many articles for laravel and vue. Whether or not to group routes is a matter of taste, but an intermediary must be inserted. For example, for jwt there will be jwt.auth

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question