Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //by default 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);
- }
- //my real postSigninReal
- public function postSigninReal(Request $request) {
- $data = [
- "username" => $request->input('email'),
- "password" => $request->input('password')
- ];
- $respon = GatewayService::login($data); //object
- if ($respon->status == true ) {
- Session::set('sessionlogin',[
- 'member_name' => $respon->member_name,
- 'member_email' => $respon->member_email,
- 'member_balance' => $respon->member_balance,
- ]);
- return Redirect::route("dashboard")->with('success', Lang::get('auth/message.signin.success'));
- } else {
- return redirect()->back()->with('error', $respon->message);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement