Improve authentication dialog with no realm
This commit is contained in:
parent
29cb9279e5
commit
b270c69ea7
@ -53,9 +53,13 @@ def custom_headers():
|
|||||||
|
|
||||||
def authentication_required(url, authenticator, abort_on):
|
def authentication_required(url, authenticator, abort_on):
|
||||||
"""Ask a prompt for an authentication question."""
|
"""Ask a prompt for an authentication question."""
|
||||||
|
realm = authenticator.realm()
|
||||||
|
if realm:
|
||||||
msg = '<b>{}</b> says:<br/>{}'.format(
|
msg = '<b>{}</b> says:<br/>{}'.format(
|
||||||
html.escape(url.toDisplayString()),
|
html.escape(url.toDisplayString()), html.escape(realm))
|
||||||
html.escape(authenticator.realm()))
|
else:
|
||||||
|
msg = '<b>{}</b> needs authentication'.format(
|
||||||
|
html.escape(url.toDisplayString()))
|
||||||
answer = message.ask(title="Authentication required", text=msg,
|
answer = message.ask(title="Authentication required", text=msg,
|
||||||
mode=usertypes.PromptMode.user_pwd,
|
mode=usertypes.PromptMode.user_pwd,
|
||||||
abort_on=abort_on)
|
abort_on=abort_on)
|
||||||
|
Loading…
Reference in New Issue
Block a user