def missing_auth(handler: ZoeRequestHandler): """Sends a 401 response that enables basic auth""" handler.set_status( 401, 'Could not verify your access level for that URL. You have to login with proper credentials.' ) handler.set_header('WWW-Authenticate', 'Basic realm="Login Required"') handler.finish()
def error_page(handler: ZoeRequestHandler, error_message: str, status: int): """Generate an error page.""" handler.set_status(status) handler.render('error.html', error=error_message)
def missing_auth(handler: ZoeRequestHandler): """Sends a 401 response that enables basic auth""" handler.set_status(401, 'Could not verify your access level for that URL. You have to login with proper credentials.') handler.set_header('WWW-Authenticate', 'Basic realm="Login Required"') handler.finish()
def error_page(handler: ZoeRequestHandler, error_message: str, status: int): """Generate an error page.""" handler.set_status(status) handler.render('error.html', error=error_message)