@@ -18,25 +18,27 @@ def __init__(
1818 :param app: Dash app
1919 :param username_password_list: username:password list, either as a
2020 list of tuples or a dict
21- :param auth_func: python function accepting two string arguments (username, password)
22- and returning a boolean (True if the user has access otherwise False).
21+ :param auth_func: python function accepting two string
22+ arguments (username, password) and returning a
23+ boolean (True if the user has access otherwise False).
2324 """
2425 Auth .__init__ (self , app )
2526 self ._auth_func = auth_func
2627 if self ._auth_func is not None :
2728 if username_password_list is not None :
28- raise ValueError ("BasicAuth can only use authorization function (auth_func kwarg) "
29- "or username_password_list, it cannot use both." )
29+ raise ValueError ("BasicAuth can only use authorization "
30+ "function (auth_func kwarg) or "
31+ "username_password_list, it cannot use both." )
3032 else :
3133 if username_password_list is None :
32- raise ValueError ("BasicAuth requires username/password map or user-defined authorization function." )
34+ raise ValueError ("BasicAuth requires username/password map "
35+ "or user-defined authorization function." )
3336 else :
3437 self ._users = (
3538 username_password_list
3639 if isinstance (username_password_list , dict )
3740 else {k : v for k , v in username_password_list }
3841 )
39-
4042
4143 def is_authorized (self ):
4244 header = flask .request .headers .get ('Authorization' , None )
0 commit comments