Skip to content

Conversation

@SegiNyn
Copy link
Contributor

@SegiNyn SegiNyn commented Sep 4, 2024

As discussed, this pr is to allow users to login with an email address linked to their account in place of their username, using the same credentials. So the email address will be checked and accepted for login if the password matches the one they already use to login with their username.
It also prevents using an email address as username. This is to avoid using an email address linked to another account as your username.

@SegiNyn SegiNyn force-pushed the allow-login-with-email branch from 3d1579d to 4f2cd2e Compare September 4, 2024 12:11
@SegiNyn SegiNyn force-pushed the allow-login-with-email branch 2 times, most recently from 7719ba1 to 0032113 Compare September 4, 2024 13:27
@SegiNyn SegiNyn changed the title Allow users to login with user email address Allow users to login with their email address Sep 4, 2024
@SegiNyn SegiNyn changed the title Allow users to login with their email address Allow users to login using their email address Sep 4, 2024
@SegiNyn SegiNyn force-pushed the allow-login-with-email branch from 0032113 to 1791333 Compare September 11, 2024 12:54
@SegiNyn SegiNyn force-pushed the allow-login-with-email branch 2 times, most recently from 2deb725 to 0cd0ccb Compare September 18, 2024 08:00
@SegiNyn SegiNyn requested a review from ThiefMaster September 18, 2024 08:19
@SegiNyn SegiNyn force-pushed the allow-login-with-email branch 2 times, most recently from ddbf987 to 57c429c Compare October 1, 2024 14:41
@SegiNyn
Copy link
Contributor Author

SegiNyn commented Oct 9, 2024

Hi @ThiefMaster, we'd like to add some template hooks so we can stop overriding some full files and it's related to changes made in this pr. Is it ok to include the hooks here rather than in a separate pr?

@ThiefMaster
Copy link
Member

Fine for me, if they are too noisy I'll let you know and you can move them to a separate PR.

@SegiNyn SegiNyn force-pushed the allow-login-with-email branch from 0c0d290 to 4a90943 Compare October 10, 2024 13:01
@SegiNyn SegiNyn force-pushed the allow-login-with-email branch from 4a90943 to 519e439 Compare November 25, 2024 09:41
@SegiNyn SegiNyn force-pushed the allow-login-with-email branch from 519e439 to efe683f Compare January 17, 2025 12:59
@ThiefMaster ThiefMaster force-pushed the allow-login-with-email branch 2 times, most recently from a9963ac to 5b2a322 Compare February 14, 2025 14:33
Copy link
Member

@ThiefMaster ThiefMaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving these comments since I already wrote them, but since I'll most likely add some additional things to this PR before merging it, I'm removing the commit adding them from here - please open a new PR to add those hooks.

<div id="credentials-form" {%- if not form.is_submitted() %} style="display: none;"{% endif %}>
{{ form_header(form, orientation='vertical', classes='no-block-padding') }}
{{ form_rows(form) }}
{{ template_hook('below-account-form', include_form_style=false) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would pass the user here

{% else %}
{{ form_header(form, orientation='vertical', classes='no-block-padding') }}
{{ form_rows(form) }}
{{ template_hook('below-account-form', new_prefix=true, include_form_style=false) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what new_prefix is supposed to mean, but it does not seem necessary since the code handling the template hook can simply check for if user.local_identity


{{ form_header(form) }}
{{ form_rows(form, widget_attrs=widget_attrs) }}
{{ template_hook('below-account-form') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You use this in many different places, with no context whatsoever. I don't think this is a ghood idea. Either pass an argument indicating where it is, but maybe separate hooks (reset-password-below-account-form etc.) may be better.

@ThiefMaster ThiefMaster force-pushed the allow-login-with-email branch from cc3dc43 to f72bdf8 Compare February 14, 2025 15:36
@ThiefMaster ThiefMaster added this to the v3.3 milestone Feb 16, 2025
@ThiefMaster ThiefMaster merged commit a502846 into indico:master Feb 16, 2025
10 checks passed
@ThiefMaster ThiefMaster deleted the allow-login-with-email branch February 16, 2025 00:57
SegiNyn added a commit to UNOG-Indico/indico-core that referenced this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants