Skip to content

email login_hint support when login_with_email_allowed is activated #4568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mcalinghee
Copy link
Contributor

It is now possible to forward the login_hint with a mxid to the upstream providers thanks to #4512

This PR allows us to support the login_hint with an email when login_with_email_allowed is activated.
In particular this PR will display the login_hint ie. email on the MAS login page.

@mcalinghee mcalinghee marked this pull request as draft May 15, 2025 08:47
@mcalinghee mcalinghee force-pushed the feat/login_hint_with_email branch from 86e806c to 34762a6 Compare May 15, 2025 11:32
@mcalinghee mcalinghee marked this pull request as ready for review May 15, 2025 11:36
@mcalinghee
Copy link
Contributor Author

Might be re-adapted if this PR goes through : #4571

@mcalinghee mcalinghee force-pushed the feat/login_hint_with_email branch from 34762a6 to 9c9cc3d Compare June 3, 2025 13:15
@@ -142,6 +144,7 @@ impl AuthorizationGrantStage {

pub enum LoginHint<'a> {
MXID(&'a UserId),
EMAIL(lettre::Address),
Copy link
Member

Choose a reason for hiding this comment

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

In the case before, MXID is an ~acronym, hence the caps, but for emails it should follow the regular naming convention

Suggested change
EMAIL(lettre::Address),
Email(lettre::Address),

@@ -197,6 +200,16 @@ impl AuthorizationGrant {

LoginHint::MXID(mxid)
}
"email" => {
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 convinced "email" should be a prefix. We've defined that in the MSC specifically for mxid:, but more generally, having emails as-is for login_hint is somewhat supported?

Comment on lines 31 to 32
# Emails
lettre.workspace = true
Copy link
Member

Choose a reason for hiding this comment

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

Can you put that in the list of external crates up there without the comment for consistency?

@mcalinghee mcalinghee force-pushed the feat/login_hint_with_email branch 3 times, most recently from 0a1c9a2 to 52bb16b Compare June 5, 2025 13:41
@mcalinghee mcalinghee requested a review from sandhose June 5, 2025 13:42
@mcalinghee mcalinghee marked this pull request as draft June 5, 2025 16:09
@mcalinghee mcalinghee force-pushed the feat/login_hint_with_email branch from 52bb16b to 07ac7ca Compare June 5, 2025 16:17
@mcalinghee mcalinghee marked this pull request as ready for review June 5, 2025 16:18
@mcalinghee mcalinghee force-pushed the feat/login_hint_with_email branch 4 times, most recently from aecb1c9 to 7feb894 Compare June 6, 2025 08:58
@mcalinghee mcalinghee force-pushed the feat/login_hint_with_email branch from 7feb894 to 704acfd Compare June 12, 2025 09:12
@mcalinghee mcalinghee force-pushed the feat/login_hint_with_email branch from 704acfd to 2e23003 Compare June 12, 2025 09:24
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.

3 participants