Skip to content

Commit

Permalink
feat(accounts): note about legacy accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoeejoee committed Dec 17, 2023
1 parent da0a15a commit 55b3272
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fiesta/apps/accounts/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,18 @@ <h1 class="card-title">{% trans "Log in" %}</h1>
type="checkbox"
class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300">
</div>
<div class="ml-3 text-sm">
<label for="{{ form.remember.name }}" class="font-medium test-base-content">Remember me</label>
<div class="ml-3 link link-neutral link-hover">
<label for="{{ form.remember.name }}">Remember me</label>
</div>
</div>
<a href="{% url 'account_reset_password' %}"
class="link link-neutral link-hover text-base-content">Lost Password?</a>
</div>

<div class="text-sm font-medium text-gray-500 inline-flex justify-between">
<span>Coming from <span class="text-secondary">fiesta.esncz.org</span>?</span>
<span>Use your original account to log in.</span>
</div>
<button type="submit" class="btn btn-primary btn-block">Log in to your account</button>
{# social accounts logins do have their own forms, so it cannot be nested #}
</form>
Expand Down
4 changes: 4 additions & 0 deletions fiesta/apps/accounts/templates/account/signup_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ <h1 class="card-title">{{ card_title|default:"Create Account" }}</h1>
value="{{ redirect_field_value }}" />
{% endif %}
<hr>
<div class="text-sm font-medium text-gray-500 inline-flex justify-between">
<span>Coming from <span class="text-secondary">fiesta.esncz.org</span>?</span>
<span>Use your original account to <a href="{{ login_url }}" class="link link-primary link-hover">log in</a>.</span>
</div>
{% include "fiestaforms/parts/errors.html" with errors=form.non_field_errors %}
{% include "fiestaforms/parts/field.html" with bf=form.email errors=form.errors.email %}
{% include "fiestaforms/parts/field.html" with bf=form.password1 errors=form.errors.password1 %}
Expand Down
5 changes: 5 additions & 0 deletions fiesta/fiesta/settings/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ class AuthConfigMixin:
# social account settings
SOCIALACCOUNT_AUTO_SIGNUP = True # after social login, do not enforce a signup form (only in case of conflict)
SOCIALACCOUNT_ADAPTER = "apps.accounts.adapters.SocialAccountAdapter"

# trust providers when providing email and connect the account to the existing one
SOCIALACCOUNT_EMAIL_AUTHENTICATION = True
# general django urls
LOGIN_URL = "/auth/login"
LOGIN_REDIRECT_URL = "/accounts/after-login"

ACCOUNT_LOGIN_ON_PASSWORD_RESET = False # do not autologin after password reset

ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True # logout after password change

ACCOUNT_USERNAME_MIN_LENGTH = 4 # a personal preference

0 comments on commit 55b3272

Please sign in to comment.