Skip to content

Commit

Permalink
Get emails from Google Auth.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Sargent committed Feb 13, 2024
1 parent 288eb39 commit b077080
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
12 changes: 11 additions & 1 deletion approval_polls/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,21 @@
"client_id": "766775776124-db3o7dn963di14rteuue1hkeg1hmh1mv.apps.googleusercontent.com",
"secret": env("GOOGLE_SECRET", str, default=""),
"key": "",
}
},
"SCOPE": [
"profile",
"email",
],
}
}

SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT = True
SOCIALACCOUNT_EMAIL_AUTHENTICATION = True
ACCOUNT_EMAIL_VERIFICATION = True
ACCOUNT_CONFIRM_EMAIL_ON_GET = True
ACCOUNT_AUTHENTICATION_METHOD = "email"
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True
ACCOUNT_SESSION_REMEMBER = True
if not DEBUG:
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
11 changes: 4 additions & 7 deletions approval_polls/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
alt="Sign in with Google"
width="200 em" />
</a>
{% comment %}
<div class="container">
<div class="row justify-content-center">
<div class="col-md-5">{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}</div>
</div>
</div> {% endcomment %}
{% comment %} {% endif %} {% endcomment %}
<script src="//accounts.google.com/gsi/client" async></script>
<div id="g_id_onload" data-client_id=766775776124-db3o7dn963di14rteuue1hkeg1hmh1mv.apps.googleusercontent.com
" data-login_uri="{% url 'google_login_by_token' %}"
</div>
<hr />
{% url 'account_login' as login_url %}
{% element form form=form method="post" action=login_url tags="entrance,login" %}
Expand Down

0 comments on commit b077080

Please sign in to comment.