Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // public function postSignin(Request $request)
- // {
- //
- // $data = [
- // "username" => $request->input('email'),
- // "password" => $request->input('password')
- // ];
- //
- // $respon=GatewayService::login($data);
- //
- // if ($respon->status == true)
- // {
- // return redirect('/');
- // }
- // else
- // {
- // return redirect()->back()->with('error', $respon->message);
- // }
- //
- // }postSignin
- public function postSignin(Request $request)
- {
- try {
- // Try to log the user in
- if (Sentinel::authenticate($request->only(['email', 'password']), $request->get('remember-me', false)))
- {
- // Redirect to the dashboard page
- return Redirect::route("dashboard")->with('success', Lang::get('auth/message.signin.success'));
- }
- $this->messageBag->add('email', Lang::get('auth/message.account_not_found'));
- } catch (NotActivatedException $e) {
- $this->messageBag->add('email', Lang::get('auth/message.account_not_activated'));
- } catch (ThrottlingException $e) {
- $delay = $e->getDelay();
- $this->messageBag->add('email', Lang::get('auth/message.account_suspended', compact('delay' )));
- }
- // Ooops.. something went wrong
- return back()->withInput()->withErrors($this->messageBag);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement