예제 #1
0
파일: UserService.php 프로젝트: so1/owl
 /**
  * Get a user by login token.
  *
  * @param string  $token
  * @return \stdclass | bool
  */
 public function getByToken($token)
 {
     $TWO_WEEKS = 14;
     $limit = Carbon::now()->subDays($TWO_WEEKS);
     $tokenResult = $this->loginTokenRepo->getValidLoginToken($token, $limit);
     if (isset($tokenResult)) {
         $user = $this->getById($tokenResult->user_id);
         return $user;
     } else {
         return false;
     }
 }
예제 #2
0
파일: AuthService.php 프로젝트: owl/owl
 public function deleteOldRememberToken($token)
 {
     $this->loginTokenRepo->deleteLoginTokenByToken($token);
 }
예제 #3
0
파일: UserService.php 프로젝트: owl/owl
 /**
  * Update the "remember me" token by user ID.
  *
  * @param int     $userId
  * @param string  $token
  *
  * @return bool
  */
 public function updateToken($userId, $token)
 {
     $params = compact('token');
     $wkey = ['user_id' => $userId];
     return (bool) $this->loginTokenRepo->update($params, $wkey);
 }