Skip to content

remove prefix when forwarding the login_hint #4571

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

Draft
wants to merge 1 commit 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

We are using a prefix mxid in the login_hint (login_hint is in the form of mxid:@localpart:homeserver) to know the type of the login_hint.
This prefix is useful between the MAS and their clients but on the upstream providers side, it is usually not supported unless we customize them.

@mcalinghee
Copy link
Contributor Author

We can change this PR to add a configuration to forward_login_hint_with_prefix or not

@sandhose
Copy link
Member

sandhose commented Jun 3, 2025

I'm not convinced we should specifically strip prefixes when forwarding login hints. Maybe @tonkku107 suggestion to have a minijinja template for this makes sense? So in this case, if you need to do the mxid:@localpart:server transformation with a template, that would be:

{{ login_hint | split("mxid:@") | reverse | first | split(":") | first }}

@mcalinghee mcalinghee force-pushed the feat/login_hint_remove_prefix branch from 0770693 to dc76bbc Compare June 5, 2025 08:21
@mcalinghee mcalinghee marked this pull request as draft June 17, 2025 09:17
@mcalinghee mcalinghee marked this pull request as draft June 17, 2025 09:17
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