diff --git a/anonstream/routes/wrappers.py b/anonstream/routes/wrappers.py index ad8da2b..8a4484d 100644 --- a/anonstream/routes/wrappers.py +++ b/anonstream/routes/wrappers.py @@ -33,14 +33,21 @@ def auth_required(f): async def wrapper(*args, **kwargs): if check_auth(request): return await f(*args, **kwargs) - hint = 'The broadcaster should log in with the credentials printed ' \ - 'in their terminal.' - body = ( - f'

{hint}

' - if request.authorization is None else - '

Wrong username or password. Refresh the page to try again.

' - f'

{hint}

' + hint = ( + 'The broadcaster should log in with the credentials printed in ' + 'their terminal.' ) + if request.authorization is None: + body = ( + f'\n' + f'

{hint}

\n' + ) + else: + body = ( + f'\n' + f'

Wrong username or password. Refresh the page to try again.

\n' + f'

{hint}

\n' + ) return body, 401, {'WWW-Authenticate': 'Basic'} return wrapper