Beispiel #1
0
 protected function loginAction()
 {
     $user = AuthUser::getInstance();
     $request = Service::request();
     $token = $user->login($request->post('login'), $request->post('password'));
     return $token ? ['state' => true, 'token' => $token] : ['state' => false, 'msg' => 'Неверные логин/пароль'];
 }
Beispiel #2
0
 /**
  * @return User
  */
 public static function user()
 {
     return AuthUser::getInstance()->current();
 }