matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
188 stars 94 forks source link

Fallback login spec doesn't specify what arguments `onLogin` takes (if any) #1900

Closed Johennes closed 2 months ago

Johennes commented 3 months ago

Link to problem area:

https://spec.matrix.org/v1.11/client-server-api/#login-fallback

Issue

The fallback login specification mentions a function that is called when login is completed.

The page will attempt to call the JavaScript function window.onLogin when login has been successfully completed.

It does, however, not specify what parameters the function is called with, if any.

Synapse appears to pass in the response body of the POST /login request parsed from JSON into a JavaScript object by jQuery.

$.post(matrixLogin.endpoint, JSON.stringify(data), function(response) {
    ...
    matrixLogin.onLogin(response);
})

Dendrite has copied Synapse's behavior.

On the client-side, element-ios, for instance, depends on this behavior and parses the passed argument to a login response.

Similar to the argument made in https://github.com/matrix-org/matrix-spec/issues/640#issuecomment-2209163225, I suspect this is simply a spec omission that we can fix without an MSC?

clokep commented 3 months ago

I think if that is what synapse has always done since implementing this then we can just clarify the spec.