let userid work with and without @

master
f0x 5 years ago
parent 8fca6793ae
commit 36876be123

@ -42,6 +42,7 @@ let App = create({
},
loginCallback: function(userId, accessToken, apiUrl) {
userId = '@' + userId.replace('@', '')
let backend = new Matrix(userId, accessToken, apiUrl)
this.setState({
backend: backend

@ -67,9 +67,11 @@ let login = create({
}).then((response) => response.json())
.then((responseJson) => {
console.log("got access token", responseJson)
this.setState({json: responseJson});
this.setState({json: responseJson})
if(responseJson.access_token != undefined) {
this.props.callback(user, responseJson.access_token, hs)
this.props.callback(responseJson.user_id, responseJson.access_token, hs)
} else {
this.setState({error: responseJson.error})
}
})
.catch((error) => {

Loading…
Cancel
Save