Skip to content

Commit

Permalink
Merge pull request #49 from djpugh/fix/login_ui-safe
Browse files Browse the repository at this point in the history
Adding login_ui safe filter
  • Loading branch information
djpugh authored Dec 21, 2020
2 parents 79bf0f7 + cea1050 commit 4fa2877
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/fastapi_aad_auth/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def _login(self, request: Request, *args, **kwargs):
if 'login' not in context or context['login'] is None: # type: ignore
post_redirect = self._authenticator._session_validator.pop_post_auth_redirect(request)
context['login'] = '<br>'.join([provider.get_login_button(post_redirect) for provider in self._authenticator._providers]) # type: ignore
self.logger.debug(f'Context {context}')
return self.login_templates.TemplateResponse(self.login_template_path.name, context) # type: ignore

def _get_user(self, request: Request, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions src/fastapi_aad_auth/ui/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ <h4 class="mb-3 font-weight-normal">Please sign in</h4>
{% endblock Login %}
{% block ContentFooter %}
{% if copyright %}
<p class="mt-5 mb-3 lead text-muted">© {{ copyright }}</p>
<p class="mt-5 mb-3 lead text-muted">© {{ copyright | safe }}</p>
{% endif %}
{% if explanation %}
<p class="mt-5 mb-3 lead text-muted">{{ explanation }}</p>
<p class="mt-5 mb-3 lead text-muted">{{ explanation | safe }}</p>
{% endif %}
{% endblock ContentFooter %}

</main>
</div>
</div>
Expand Down

0 comments on commit 4fa2877

Please sign in to comment.