Create new users with Laravel 5.3

Asked

Viewed 458 times

0

I ran make:auth from Aravel 5.3 but when I’m creating new users I lose my session and the new user is logged in. Does anyone know how to create a new user and continue logging in with my account?

  • How you are creating the new user, post the code!

  • I did not change the logic that the Standard already uses. I only modified the views.

  • This standard form is for "auto registration", so to speak, to have access to the system, to make a CRUD of users, create another form and popule in the database, this is only for authentication...

  • @Davidcoelho thought he had developed something, but, this code is like this: you register, and automatically is logged in to the site, it’s like to E-commerce for example. Have to create one for your website’s internal area then. Get to work!

  • 1

    Understood. Personal thank you very much! Hug.

1 answer

1


You can disable this option within the framework’s standard log file:

MeuProjeto\vendor\laravel\framework\src\Illuminate\Foundation\Auth\RegistersUsers.php

This is the method that performs the record:

public function register(Request $request)
    {
        $this->validator($request->all())->validate();

        event(new Registered($user = $this->create($request->all())));

        // Esta linha loga no usuário recém criado
        // Comente-a para não realizar o login
        $this->guard()->login($user);

        return $this->registered($request, $user)
            ?: redirect($this->redirectPath());
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.