示例#1
0
文件: API.php 项目: agandra/amp
 public function setUser()
 {
     // Should all succeed because of auth filter
     $token = APIToken::where('device_id', '=', \Input::get('device_id'))->where('token', '=', \Input::get('auth_token'))->get()->first();
     if ($token) {
         $user = \Repo::call('User')->find($token->user_id);
         if ($user) {
             \Auth::login($user);
             $this->token = $token;
         }
     }
 }