我的应用程序使用标准的Auth模块,使用电子邮件和密码组合登录。
我需要修改它,以便用户可以输入电子邮件或唯一的7位数的密码代码。
在Laravel文档中,我找到了这段代码。
if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) {
// The user is active, not suspended, and exists.
}
我已经修改了该表以包含正确的代码,但还没有弄清楚如何进行身份验证。
以前有没有人遇
我使用的是Laravel 5.2
我已经修改了authController.php中的postLogin()方法。
public function postLogin(Request $request)
{
$inputs = $request->all();
$this->validateLogin($request);
// If the class is using the ThrottlesLogins trait, we can automatically throttle
//
TLDR;我使用Valet和mailhog进行电子邮件测试。这只是一个基本的注册表单。即使在注册路径中,用户在创建用户实例后立即登录,也不会对用户进行身份验证。
在POST /register控制器中
Auth::login($user= User::create([...])); <-- here we login the user right after the user created.
event(new Registered($user));
然后,当用户单击验证电子邮件时,会发生以下情况:
Route::get('email/verify/{id}/{hash}