def check_auth ( username , pwd ) : cfg = get_current_config ( ) return username == cfg [ "dashboard_httpauth" ] . split ( ":" ) [ 0 ] and pwd == cfg [ "dashboard_httpauth" ] . split ( ":" ) [ 1 ]
checking username and passwords with dictionaries python
This function is called to check if a username / password combination is valid .
def check_auth(username, pwd):
    """This function is called to check if a username /
    password combination is valid.
    """
    cfg = get_current_config()
    return username == cfg["dashboard_httpauth"].split(
        ":")[0] and pwd == cfg["dashboard_httpauth"].split(":")[1]