'Retrieve auth tokens from the router.'

def _get_auth_tokens(self):

    _LOGGER.info('Retrieving    auth    tokens...')
    url = 'http://{}/cgi-bin/luci/;stok=/login?form=login'.format(self.host)
    referer = 'http://{}/webpages/login.html'.format(self.host)
    response = requests.post(url, params={'operation': 'login', 'username': self.username, 'password': self.password}, headers={'referer': referer}, timeout=4)
    try:
        self.stok = response.json().get('data').get('stok')
        _LOGGER.info(self.stok)
        regex_result = re.search('sysauth=(.*);', response.headers['set-cookie'])
        self.sysauth = regex_result.group(1)
        _LOGGER.info(self.sysauth)
        return True
    except (ValueError, KeyError) as _:
        _LOGGER.error("Couldn't    fetch    auth    tokens!    Response    was:    %s", response.text)
        return False
