public function updateUserRefreshToken(BaseUser $user)
    {
        if (!$user->isRefreshTokenValid()) {
            $user->setRefreshToken(bin2hex(random_bytes(90)));
        }

        $expirationDate = new \DateTime();
        $expirationDate->modify('+' . $this->refreshTokenTTL . ' seconds');
        $user->setRefreshTokenExpire($expirationDate);
        $this->save($user);

        return $user;
    }
public function updateUserRefreshToken(BaseUser $user)
    {
        if (!$user->isRefreshTokenValid()) {
            $user->setRefreshToken(bin2hex(random_bytes(90)));
        }

        $expirationDate = new \DateTime();
        $expirationDate->modify('+' . $this->refreshTokenTTL . ' seconds');
        $user->setRefreshTokenExpire($expirationDate);
        $this->save($user);

        return $user;
    }
public function updateUserRefreshToken ( BaseUser $ user ) { if ( ! $ user -> isRefreshTokenValid ( ) ) { $ user -> setRefreshToken ( bin2hex ( random_bytes ( 90 ) ) ) ; } $ expirationDate = new \ DateTime ( ) ; $ expirationDate -> modify ( '+' . $ this -> refreshTokenTTL . ' seconds' ) ; $ user -> setRefreshTokenExpire ( $ expirationDate ) ; $ this -> save ( $ user ) ; return $ user ; }
Saves the user with an updated refresh token

@param BaseUser|RefreshTokenTrait $user

@return BaseUser
Saves the user with an updated refresh token