namespace BookStack\Http\Controllers\Auth;
+use BookStack\Auth\SocialAccount;
+use BookStack\Auth\User;
+use BookStack\Auth\UserRepo;
use BookStack\Exceptions\SocialSignInAccountNotUsed;
use BookStack\Exceptions\SocialSignInException;
use BookStack\Exceptions\UserRegistrationException;
-use BookStack\Repos\UserRepo;
-use BookStack\Services\EmailConfirmationService;
-use BookStack\Services\SocialAuthService;
-use BookStack\SocialAccount;
-use BookStack\User;
+use BookStack\Http\Controllers\Controller;
use Exception;
+use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
-use Validator;
-use BookStack\Http\Controllers\Controller;
-use Illuminate\Foundation\Auth\RegistersUsers;
use Laravel\Socialite\Contracts\User as SocialUser;
+use Validator;
class RegisterController extends Controller
{
/**
* Create a new controller instance.
*
- * @param SocialAuthService $socialAuthService
- * @param EmailConfirmationService $emailConfirmationService
- * @param UserRepo $userRepo
+ * @param \BookStack\Auth\Access\SocialAuthService $socialAuthService
+ * @param \BookStack\Auth\EmailConfirmationService $emailConfirmationService
+ * @param \BookStack\Auth\UserRepo $userRepo
*/
- public function __construct(SocialAuthService $socialAuthService, EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
+ public function __construct(\BookStack\Auth\Access\SocialAuthService $socialAuthService, \BookStack\Auth\Access\EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
{
$this->middleware('guest')->only(['getRegister', 'postRegister', 'socialRegister']);
$this->socialAuthService = $socialAuthService;
protected function validator(array $data)
{
return Validator::make($data, [
- 'name' => 'required|max:255',
+ 'name' => 'required|min:2|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6',
]);
/**
* Create a new user instance after a valid registration.
* @param array $data
- * @return User
+ * @return \BookStack\Auth\User
*/
protected function create(array $data)
{
*/
public function getRegisterConfirmation()
{
- return view('auth/register-confirm');
+ return view('auth.register-confirm');
}
/**
*/
public function showAwaitingConfirmation()
{
- return view('auth/user-unconfirmed');
+ return view('auth.user-unconfirmed');
}
/**