diff --git a/app.js b/app.js index 5d515c0..7af99a5 100644 --- a/app.js +++ b/app.js @@ -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 diff --git a/components/Login.js b/components/Login.js index 6a88d15..aaa1bd9 100644 --- a/components/Login.js +++ b/components/Login.js @@ -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) => {