<commit_before><?php namespace App\Http\Controllers\Auth;

use App\User;
use App\Board;
use Validator;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AuthController extends Controller {

	/*
	|--------------------------------------------------------------------------
	| Registration & Login Controller
	|--------------------------------------------------------------------------
	|
	| This controller handles the registration of new users, as well as the
	| authentication of existing users. By default, this controller uses
	| a simple trait to add these behaviors. Why don't you explore it?
	|
	*/
	// Add protected property to use username as default for login in trait
	
	use AuthenticatesAndRegistersUsers;

	/**
	 * Create a new authentication controller instance.
	 *
	 * @param  \Illuminate\Contracts\Auth\Guard  $auth
	 * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
	 * @return void
	 */
	public function __construct()
	{
		$this->middleware('guest', ['except' => 'getLogout']);
	}
	/**
	 * Get a validator for an incoming registration request.
	 *
	 * @param  array  $data
	 * @return \Illuminate\Contracts\Validation\Validator
	 */
	public function validator(array $data)
	{
		return Validator::make($data, [
			'email' => 'required|email|max:255|unique:users',
			'password' => '<PASSWORD>',
		]);
	}

	/**
	 * Create a new user instance after a valid registration.
	 *
	 * @param  array  $data
	 * @return User
	 */
	public function create(array $data)
	{

		$user = User::create([
			'username' => $data['username'],
			'email' => $data['email'],
			'password' => <PASSWORD>($data['password']),
		]);

            // Create the user's personal pinboard
            if ($user) :
                $personalboard = Board::Create(['title' => 'My Personal Activities','body' => 'I will do these All Day! Erry Day!','shared_with' => 0, 'id_users'=> $user->id]);
            endif;
<commit_msg>Upgrade - User Login fix<commit_after><?php namespace App\Http\Controllers\Auth;

use App\User;
use App\Board;
use Validator;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AuthController extends Controller {

	/*
	|--------------------------------------------------------------------------
	| Registration & Login Controller
	|--------------------------------------------------------------------------
	|
	| This controller handles the registration of new users, as well as the
	| authentication of existing users. By default, this controller uses
	| a simple trait to add these behaviors. Why don't you explore it?
	|
	*/
	// Add protected property to use username as default for login in trait
	## username login uncomment this protected $username = 'username';
	
	use AuthenticatesAndRegistersUsers;

	/**
	 * Create a new authentication controller instance.
	 *
	 * @param  \Illuminate\Contracts\Auth\Guard  $auth
	 * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
	 * @return void
	 */
	public function __construct()
	{
		$this->middleware('guest', ['except' => 'getLogout']);
	}
	/**
	 * Get a validator for an incoming registration request.
	 *
	 * @param  array  $data
	 * @return \Illuminate\Contracts\Validation\Validator
	 */
	public function validator(array $data)
	{
		return Validator::make($data, [
			## username login uncomment this 'username' => 'required|max:50|unique:users',
			'email' => 'required|email|max:255|unique:users',
			'password' => '<PASSWORD>',
		]);
	}

	/**
	 * Create a new user instance after a valid registration.
	 *
	 * @param  array  $data
	 * @return User
	 */
	public function create(array $data)
	{

		$user = User::create([
			'username' => $data['username'],
			'email' => $data['email'],
			'password' => <PASSWORD>($data['password']),
		]);

            // Create the user's personal pinboard
            if ($user) :
                $personalboard = Board::Create(['title' => 'My Personal Activities','body' => 'I will do these All Day! Erry Day!','shared_with' => 0, 'id_users'=> $user->id]);
            endif;

{'fraction_non_alphanumeric': 0.19381298336067496, 'fraction_numerical': 0.002343566908835247, 'mean_word_length': 2.7016478751084128, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2012040', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1191, 'n_words': 344}