ement.el icon indicating copy to clipboard operation
ement.el copied to clipboard

m.login.password identifier

Open tpeacock19 opened this issue 3 years ago • 1 comments

I'm not sure if you've experienced this, but when using Conduit I get an error with the current login flow. The below diff is current with the latest protocol identifier types seen here.

diff --git a/ement.el b/ement.el
index b5e6238..9cec1c0 100644
--- a/ement.el
+++ b/ement.el
@@ -203,7 +203,9 @@ the port, e.g.
                () (pcase-let* (((cl-struct ement-session user device-id initial-device-display-name) session)
                                ((cl-struct ement-user id) user)
                                (data (ement-alist "type" "m.login.password"
-                                                  "user" id
+                                                  "identifier"
+                                                  (ement-alist "type" "m.id.user"
+                                                               "user" id)
                                                   "password" password
                                                   "device_id" device-id
                                                   "initial_device_display_name" initial-device-display-name)))

This also could allow for users to potentially login with a 3pid using m.id.thirdparty in place of m.id.user, but that would of course require more logic.

tpeacock19 avatar Apr 16 '22 00:04 tpeacock19

Thanks, I didn't know they had changed that in the spec. I'd guess that you might want to report that to Conduit as well, because they might be excluding some older clients by requiring this. Anyway, I'll apply this change soon. :)

alphapapa avatar Apr 21 '22 18:04 alphapapa

This appears to have changed between spec version r0.3.0 ( https://matrix.org/docs/spec/client_server/r0.3.0.html#password-based ) and r0.4.0 ( https://matrix.org/docs/spec/client_server/r0.4.0.html#password-based ). Conduit claims the following version support: "versions":["r0.5.0","r0.6.0","v1.1","v1.2"], so it not supporting the r0.3.0 login API (which is the only one supported by Ement) seems to match what is documented.

viiru- avatar Feb 08 '23 09:02 viiru-

@viiru- Thanks for researching that. I'll target this for the 0.6 release.

alphapapa avatar Feb 10 '23 04:02 alphapapa

Thanks to all for your help with this.

alphapapa avatar Feb 24 '23 16:02 alphapapa