Need an API for logout
Rather than assuming that the app knows to call window.localStorage.clear() or whatever
The specific concern is around things like mxjssdk_memory_filter_*.
Currently the loginWithPassword isn't technically a full featured login either -- e.g. my application's login looks like this:
login(username, password) {
_login = function () {
delete client.credentials.userId
delete client._http.opts.accessToken
return client.loginWithPassword(username, password).then((result) => {
client.credentials.userId = result.user_id
client._http.opts.accessToken = result.access_token
this.userId = client.credentials.userId
}, (error) => {
console.log(error)
})
}.bind(this)
if (client.credentials.userId) {
return client.logout().then(_login)
} else {
return _login()
}
},
To compare the matrix-python-sdk does setup access credentials within the login method rather than requiring to be done manually and in a sense I think that's the better thing to do, if users need login / logout endpoint calls that don't update the client I would suggest leaving _login / _logout for that purpose (it should be a very rare case though).