public function createToken(AccountInterface $user)
    {
        $lifespan = variable_get('user_password_reset_timeout', 86400);

        $token = new Token();
        $token->uid = $user->id();
        $token->expiration_date = (new \DateTime())->add(new \DateInterval('PT' . $lifespan . 'S'));
        $token->generateKey();
        $this->saveToken($token);

        return $token;
    }