Skip to content

Commit fa864ff

Browse files
authored
Use Allauth settings for app name and hiding on login/connect forms (#12242)
The `settings` attribute isn't super well documented, but it is used from the template tag for listing providers. We can also use settings for arbitrary values if we want. See https://codeberg.org/allauth/django-allauth/src/commit/b74b04a8261486db8a3823c26c188820aed599aa/allauth/socialaccount/templatetags/socialaccount.py#L84
1 parent e79f254 commit fa864ff

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

readthedocs/settings/base.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,18 @@ def DOCKER_LIMITS(self):
686686
_SOCIALACCOUNT_PROVIDERS = {
687687
"github": {
688688
"APPS": [
689-
{"client_id": "123", "secret": "456", "key": ""},
689+
{
690+
"name": "GitHub OAuth",
691+
"client_id": "123",
692+
"secret": "456",
693+
"key": "",
694+
"settings": {
695+
"hidden": False,
696+
"hidden_on_login": False,
697+
"hidden_on_connect": False,
698+
"priority": 10,
699+
},
700+
},
690701
],
691702
"SCOPE": [
692703
"user:email",
@@ -697,14 +708,25 @@ def DOCKER_LIMITS(self):
697708
},
698709
"githubapp": {
699710
"APPS": [
700-
{"client_id": "123", "secret": "456", "key": ""},
711+
{
712+
"name": "GitHub App",
713+
"client_id": "123",
714+
"secret": "456",
715+
"key": "",
716+
"settings": {
717+
"hidden": False,
718+
"hidden_on_login": False,
719+
"hidden_on_connect": False,
720+
"priority": 20,
721+
},
722+
},
701723
],
702724
# Scope is determined by the GitHub App permissions.
703725
"SCOPE": [],
704726
},
705727
"gitlab": {
706728
"APPS": [
707-
{"client_id": "123", "secret": "456", "key": ""},
729+
{"client_id": "123", "secret": "456", "key": "", "settings": {"priority": 30}},
708730
],
709731
# GitLab returns the primary email only, we can trust it's verified.
710732
"VERIFIED_EMAIL": True,
@@ -715,7 +737,7 @@ def DOCKER_LIMITS(self):
715737
},
716738
"bitbucket_oauth2": {
717739
"APPS": [
718-
{"client_id": "123", "secret": "456", "key": ""},
740+
{"client_id": "123", "secret": "456", "key": "", "settings": {"priority": 40}},
719741
],
720742
# Bitbucket scope/permissions are determined by the Oauth consumer setup on bitbucket.org.
721743
},

0 commit comments

Comments
 (0)