Skip to content
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

Phone number input should not be shown if homeserver does not support it #9063

Closed
jaywink opened this issue Mar 6, 2019 · 5 comments
Closed
Labels
A-Registration X-Needs-Info This issue is blocked awaiting information from the reporter

Comments

@jaywink
Copy link
Member

jaywink commented Mar 6, 2019

Description

When creating an account for a homeserver that does not support phone based registration, the phone input is shown.

selection_068

Filling a phone number and submitting brings an error which seems like could be avoided by exposing the capabilities of the homeserver and checking them as it is known at this stage.

selection_069

Similarly, once signed up, the phone number input is visible in settings:

selection_070

Our enthusiastic user is presented with disappointment:

selection_071

Version information

Custom hosted Riot web v1.0.1 pointed to custom hosted Synapse v0.99.2.

@jryans
Copy link
Collaborator

jryans commented Mar 6, 2019

Hmm, can you share the relevant Synapse config for this HS?

The phone input on registration should already be hidden after matrix-org/matrix-react-sdk#2551, which is included in v1.0.0 and later.

@jryans jryans added X-Needs-Info This issue is blocked awaiting information from the reporter A-Registration labels Mar 6, 2019
@jaywink
Copy link
Member Author

jaywink commented Mar 12, 2019

@jryans sorry for the slow reply :P Would you be able to say which parts are relevant for the Synapse config?

What I can see is that Riot is doing a /register to client API when rendering the form which goes something like this:

https://federator-staging.modular.im/_matrix/client/r0/register
{"auth":{}}

Response:

HTTP/1.1 401 Unauthorized
Server: Synapse/0.99.2.post1

The response contains the following flows:

"flows": [
    {
      "stages": [
        "m.login.email.identity",
        "m.login.recaptcha",
        "m.login.terms"
      ]
    },
    {
      "stages": [
        "m.login.msisdn",
        "m.login.email.identity",
        "m.login.recaptcha",
        "m.login.terms"
      ]
    }
  ],

Synapse config for what I can think might be relevant:

registrations_require_3pid: 
  - email
allowed_local_3pids: 
  - medium: email
    pattern: .*@jasonrobinson\.me$
allow_guest_access: False
register_mxid_from_3pid: email
disable_3pid_changes: False
disable_set_displayname: False
disable_set_avatar_url: False

@jryans
Copy link
Collaborator

jryans commented Mar 12, 2019

Riot is showing the phone number field because you have at least one registration flow in the /register reply that includes "m.login.msisdn" as a stage.

The Synapse code for deciding which fields to include is a bit complex... It would appear that currently the only way to remove the phone from all stages (and thus hide the field), is to set:

disable_msisdn_registration: True

There's probably room for improving the way Synapse configuration works in this area.

As for the phone input appearing in Settings after registration, it's true that Riot always shows this field. I don't believe there's a clear API currently for the HS / IS to suggest where certain 3PIDs will be accepted, so that's why the field is always shown. Maybe it would be good to spin that part out as a separate issue, since it may need spec work as well?

@lampholder
Copy link
Member

@jaywink This makes me wonder: how has msisdn registration been disabled on the server in such a way that m.login.msisdn is still reported as a registration stage?

@jaywink jaywink changed the title Phone number input should not be shown if homeserver does not support it Settings phone number input should not be shown if homeserver does not support it Mar 20, 2019
@jaywink jaywink changed the title Settings phone number input should not be shown if homeserver does not support it Phone number input should not be shown if homeserver does not support it Mar 20, 2019
@jaywink
Copy link
Member Author

jaywink commented Mar 20, 2019

I'm closing this after some debugging where the result was that the phone number not working in registration phase was due to custom configuration related to allowed_local_3pids being set to a list of email domains. Removing said list makes phone based registration work.

As suggested, the settings phone number field should be handled separately. Thanks all for the help figuring this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Registration X-Needs-Info This issue is blocked awaiting information from the reporter
Projects
None yet
Development

No branches or pull requests

3 participants