Skip to content

Commit

Permalink
Merge pull request #520 from ThomasWaldmann/no-social-logins
Browse files Browse the repository at this point in the history
add hint if there are no social logins enabled
  • Loading branch information
ThomasWaldmann committed Apr 13, 2023
2 parents f24eb62 + a90824a commit 2bbec89
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
23 changes: 15 additions & 8 deletions src/nsupdate/login/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ <h2><img src="{% static "img/logo.svg" %}" alt="nsupdate.info logo" height="35"
<div class="col-md-6">
<h2>{% trans "Login with a remote Account" %}</h2>
<hr />
<div class="btn-toolbar" role="toolbar">
{% for backend in backends.backends %}
<div class="btn-group">
<a class="btn btn-default" role="button" href="{% url 'social:begin' backend %}">
<i class="fa fa-sign-in-alt fa-fw"></i> {{ backend }}
</a>
{% if backends.backends %}
<div class="btn-toolbar" role="toolbar">
{% for backend in backends.backends %}
<div class="btn-group">
<a class="btn btn-default" role="button" href="{% url 'social:begin' backend %}">
<i class="fa fa-sign-in-alt fa-fw"></i> {{ backend }}
</a>
</div>
{% endfor %}
</div>
{% else %}
<div class="jumbotron">
<p>{% trans "No remote account logins enabled." %}</p>
<p>{% trans "Please login with a local account." %}</p>
</div>
{% endfor %}
</div>
{% endif %}
</div>
</div>

Expand Down
20 changes: 10 additions & 10 deletions src/nsupdate/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,16 @@

# python-social-auth settings
AUTHENTICATION_BACKENDS = (
# 'social_core.backends.amazon.AmazonOAuth2',
# 'social_core.backends.bitbucket.BitbucketOAuth',
# 'social_core.backends.disqus.DisqusOAuth2',
# 'social_core.backends.dropbox.DropboxOAuth2V2',
# 'social_core.backends.github.GithubOAuth2',
# 'social_core.backends.google.GoogleOAuth2',
# 'social_core.backends.reddit.RedditOAuth2',
# 'social_core.backends.soundcloud.SoundcloudOAuth2',
# 'social_core.backends.stackoverflow.StackoverflowOAuth2',
# 'social_core.backends.twitter.TwitterOAuth',
'social_core.backends.amazon.AmazonOAuth2',
'social_core.backends.bitbucket.BitbucketOAuth',
'social_core.backends.disqus.DisqusOAuth2',
'social_core.backends.dropbox.DropboxOAuth2V2',
'social_core.backends.github.GithubOAuth2',
'social_core.backends.google.GoogleOAuth2',
'social_core.backends.reddit.RedditOAuth2',
'social_core.backends.soundcloud.SoundcloudOAuth2',
'social_core.backends.stackoverflow.StackoverflowOAuth2',
'social_core.backends.twitter.TwitterOAuth',
'django.contrib.auth.backends.ModelBackend',
)

Expand Down

0 comments on commit 2bbec89

Please sign in to comment.