1
我有一个表命名为“用户”正被哨兵使用的,但是我删除,我并不需要如激活码列,坚持规范等删除哨兵账户激活检查
这是结构我的表:
我试图登录使用我通过创建一个帐户“哨兵::的createUser()”但是“UserNotActivatedException”不断被抛出,并阻止我不能登录
这是。我的登录码:
public function postLogin() {
#Build login
if(!Input::has('email') || !Input::has('password')) {
return Response::json(['response' => 'Please enter an email address and a password!']);
}
try {
$credentials = [
'email' => Input::get('email'),
'password' => Input::get('password')
];
$user = Sentry::authenticate($credentials, false);
return Response::json(['response' => 'You have been logged in.']);
} catch(Cartalyst\Sentry\Users\LoginRequiredException $e) {
return Response::json(['response' => 'Please enter an email address!']);
} catch(Cartalyst\Sentry\Users\PasswordRequiredException $e) {
return Response::json(['response' => 'Please enter a password!']);
} catch(Cartalyst\Sentry\Users\WrongPasswordException $e) {
return Response::json(['response' => 'That account could not be found1!']);
} catch(Cartalyst\Sentry\Users\UserNotFoundException $e) {
return Response::json(['response' => 'That account could not be found2!']);
} catch(Cartalyst\Sentry\Users\UserNotActivatedException $e) {
return Response::json(['response' => 'That account could not be found3!']);
} catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
return Response::json(['response' => 'That account could has been suspended!']);
} catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
return Response::json(['response' => 'That account has been banned!']);
}
}
这是正在返回的响应:
有什么办法可以禁用对哨兵用户激活检查?
[你有没有用'哨兵::的createUser试了一下( array('email'=>'email','password'=>'password','activated'=> true,));'](https://cartalyst.com/manual/sentry#sentry::createuser% 28%29) – Prix 2014-10-04 13:55:26
我还没有尝试过,因为'激活'列在我的表内不存在。 – 2014-10-04 14:17:54
[与提供的相比,你的桌子看起来相当不完整。如果您对表格进行了自定义更改,则还必须更改代码以反映您的更改,例如删除已激活帐户的验证。](https://github.com/cartalyst/sentry/blob/v2.1.4 /schema/mysql.sql) – Prix 2014-10-04 14:25:24