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

Users can no longer register with token and email validation #26172

Closed
0x416c69 opened this issue Sep 15, 2023 · 12 comments
Closed

Users can no longer register with token and email validation #26172

0x416c69 opened this issue Sep 15, 2023 · 12 comments
Labels
T-Other Questions, user support, anything else

Comments

@0x416c69
Copy link

0x416c69 commented Sep 15, 2023

Steps to reproduce

  1. Configure the homeserver to only allow registration with token and enable matrix mailer
  2. Create a valid token
  3. Try to register on my own homeserver with username, password and an email and press register
  4. Enter the token and press continue

Outcome

What did you expect?

In Element Desktop, after hitting the Continue button, it'll show me a page that it's waiting for me to validate my email and after I do, my user is successfully registered and I can enter.

What happened instead?

The token is used (will no longer be valid, it'll be counted as a used token), the validation email is sent but I'm stuck in a never ending loading:

chrome_2023-09-15_10-30-56.mp4

I'm just guessing but I think this is related to this PR: matrix-org/matrix-react-sdk#11398
(Since this only happened after upgrading from an older version to the current version)


I sent one rageshake from console with a "test" message, if necessary I'll send one with a unique message.

Operating system

Windows 10

Browser information

Google Chrome 117.0.5938.63

URL for webapp

No response

Application version

Element Web 1.11.42

Homeserver

Synapse v1.92.1

Will you send logs?

Yes

@t3chguy
Copy link
Member

t3chguy commented Sep 15, 2023

I sent one rageshake from console with a "test" message, if necessary I'll send one with a unique message.

No rageshakes are showing up linked to this issue. Please send again and use the issue field with this issue's link.

image

@t3chguy t3chguy added the X-Needs-Info This issue is blocked awaiting information from the reporter label Sep 15, 2023
@0x416c69
Copy link
Author

@t3chguy I don't have access to /rageshake command, I am not logged in, how can I send a rageshake before logging in after I reproduce this?

@t3chguy
Copy link
Member

t3chguy commented Sep 15, 2023

mxSendRageshake(text, withLogs) from console or log in and then send logs, they'll still include it.

@0x416c69
Copy link
Author

@t3chguy

image

I've reproduced it in a new session, and then used this to send the rageshake.

It's worth noting that when I don't enter the email address, everything works flawlessly and the new user is registered and automatically logged in. It has to be from the email validation stuff and it's not a server issue since it's okay in Element Desktop (Element Desktop is also 1.11.42 but it works without any problems, I'm using Incognito mode so I'm not facing cache issues, also I've deployed this whole thing from https://github.com/spantaleev/matrix-docker-ansible-deploy)

@0x416c69
Copy link
Author

@t3chguy Sorry for the ping, is it possible that a hotfix for this is released sooner? Is this an easy fix? Can I be of any help?

@t3chguy
Copy link
Member

t3chguy commented Sep 18, 2023

@0x416c69 it has yet to be triaged, then reproduced, then its up to the release maintainer to decide if its worthy of a hotfix (@andybalaam)

@t3chguy t3chguy added T-Other Questions, user support, anything else and removed X-Needs-Info This issue is blocked awaiting information from the reporter T-Defect labels Sep 18, 2023
@t3chguy
Copy link
Member

t3chguy commented Sep 18, 2023

The error you're seeing seems entirely unrelated to matrix-org/matrix-react-sdk#11398

The error you're seeing is due to an invalid or no identity server being configured.

image

I suggest visiting seeking help from the ansible deploy script's support for such misconfigurations.

@t3chguy t3chguy closed this as completed Sep 18, 2023
@0x416c69
Copy link
Author

@t3chguy I'm sorry but according to https://github.com/vector-im/element-web/blob/develop/docs/config.md#identity-servers and the existing documentations on https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-ma1sd.md having an identity server is optional, I haven't configured an identity server and I don't want one. I don't see how sending an email validation (which already does send one, from Element Desktop, and works fine, maybe you'd like me to send proof or logs or something?) is related to having an identity server.

I've also disabled federation and I cannot enable federation due to some reasons, this is the config.json of the element client hosted within our website which the ansible deploy script has generated:

{
    "brand": "AGMatrix",
    "branding": {
        "auth_footer_links": [
            {
                "text": "Forum",
                "url": "https://forum.arsacia.ir"
            },
            {
                "text": "AG:SA",
                "url": "https://agsa.arsacia.ir"
            },
            {
                "text": "Wiki",
                "url": "https://wiki.arsacia.ir"
            }
        ],
        "auth_header_logo_url": "https://arsacia.ir/img/aglogo.svg",
        "welcome_background_url": "https://arsacia.ir/img/agbg.jpg"
    },
    "bug_report_endpoint_url": "https://element.io/bugreports/submit",
    "default_country_code": "GB",
    "default_server_config": {
        "m.homeserver": {
            "base_url": "https://matrix.ag5.ir",
            "server_name": "ag5.ir"
        },
        "m.identity_server": {
            "base_url": ""
        }
    },
    "default_theme": "dark",
    "disable_custom_urls": true,
    "disable_guests": true,
    "embedded_pages": {
        "homeUrl": ""
    },
    "enable_presence_by_hs_url": "\n",
    "integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html",
    "integrations_rest_url": "https://scalar.vector.im/api",
    "integrations_ui_url": "https://scalar.vector.im/",
    "integrations_widgets_urls": [
        "https://scalar.vector.im/api"
    ],
    "jitsi": {
        "preferred_domain": "jitsi.ag5.ir"
    },
    "permalink_prefix": "https://matrix.to",
    "room_directory": {
        "servers": []
    },
    "setting_defaults": {
        "custom_themes": []
    },
    "show_labs_settings": true,
    "welcome_user_id": null
}

m.identity_server.base_url is an empty string which looks to be intended when you don't have an identity server from:
https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/7586cecedffa9d0dd6762702d6018492664515dc/roles/custom/matrix-client-element/templates/config.json.j2#L8

I haven't changed any of my configurations and the client was working fine before updating to this version, my theory is that you're looking at an unrelated error and the registration steps are unrelated to the error you're seeing. I don't know if according to the new updates an identity server is required for a mere email validation system but if that's the case, I don't see how that makes any sense and I will have to run an identity server, so please let me know.

@t3chguy
Copy link
Member

t3chguy commented Sep 19, 2023

Element Desktop

Are you using Element Desktop from element.io? That one has an IS pre-configured - https://github.com/vector-im/element-desktop/blob/develop/element.io/release/config.json#L8-L10

AFAIK

        "m.identity_server": {
            "base_url": ""
        }

is invalid, it should be omitted entirely rather than specifying an empty base_url.

https://spec.matrix.org/v1.8/client-server-api/#getwell-knownmatrixclient says the base_url field is required, but the m.identity_server field is not. If you're using out-of-spec configurations and things break then that is to be expected.

@0x416c69
Copy link
Author

@t3chguy You're right, after configuring the "base_url" to https://vector.im everything works fine now. I guess this is a bug from https://github.com/spantaleev/matrix-docker-ansible-deploy/ after all. I guess I should move away from them and configure everything manually myself from the specifications.

@cremesk
Copy link

cremesk commented Sep 21, 2023

@t3chguy i can see the same error without an defined identity server like:

{
    "default_server_config": {
        "m.homeserver": {
            "base_url": "https://matrix.envs.net",
            "server_name": "envs.net"
        }
    },
..

with an identity server like vector it works:

{
    "default_server_config": {
        "m.homeserver": {
            "base_url": "https://matrix.envs.net",
            "server_name": "envs.net"
        },
        "m.identity_server": {
            "base_url": "https://vector.im"
        }
    },
...

@0x416c69
Copy link
Author

@cremesk True, I also got rid of "m.identity_server" but still got the same error, it only works with a valid identity server which is against the specification and could be a bug (?, I still haven't read the specifications for registration flow and email validation):

If the m.identity_server property is present, extract the base_url value for use as the base URL of the identity server. Validation for this URL is done as in the step above, but using /_matrix/identity/v2 as the endpoint to connect to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Other Questions, user support, anything else
Projects
None yet
Development

No branches or pull requests

3 participants