![]() ![]() >with('message',"O seu usuário ainda não foi ativado na nossa loja. $user = Sentry::getUserProvider()->findByLogin(Input::get('email')) Įmail::queue($user, '', 'Ativação da sua conta na Vevey') >with('message','O campo do senha é necessário.') Ĭatch (Cartalyst\Sentry\Users\UserNotActivatedException $e) >with('message','O campo do e-mail é necessário.') Ĭatch (Cartalyst\Sentry\Users\PasswordRequiredException $e) >with('message','Você efetuou login com sucesso em nossa loja.') Ĭatch (Cartalyst\Sentry\Users\LoginRequiredException $e) $user = Sentry::authenticate($credentials, Input::has('remember_me') and Input::get('remember_me') = 'checked') 'password' => Input::has('password') ? Input::get('password') : null, 'email' => Input::has('email') ? Input::get('email') : null, Messages are in portuguese, but if you need me to translate just tell. I'm basically letting Sentry do everything for me validation, find the user and, of course, login the user. What am I doing wrong here or not understanding.Ĭode below is my login method using Sentry 2. I tried using this approach but it throws an exception: that id is unknown despite id being part of the table and User model being nothing but a class declaration with a $table = 'users' attribute. Session::flash('error', 'Wrong Username or Password !') $user = Sentry::getUserProvider()->findById($fetch->id) $fetch = User::where('username', '=', trim(Input::get('username'))) Session::flash('error', $validator->errors()) $validator = Validator::make(Input::all(), $rules) Second the login method now takes a User object that you need to retrieve using user's id which again makes no sense as you don't know the users id unless you make another query so they really complicated everything. Provide username/email and password from Input to Sentry::login() method however they changed it now and it's really confusing.įirst of all they removed Username column which makes no sense. I mean in Sentry it was pretty strait forward. I'm having trouble understanding Sentry 2 implementation for login. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |