You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Handle errors with scalar-oauthing
Handle error getting the scalar token and check for non-success status codes in the response handler (because apparently browser-request doesn't consider that an error).
This commit is contained in:
@@ -32,6 +32,8 @@ class ScalarAuthClient {
|
||||
}, (err, response, body) => {
|
||||
if (err) {
|
||||
defer.reject(err);
|
||||
} else if (response.statusCode / 100 !== 2) {
|
||||
defer.reject({statusCode: response.statusCode});
|
||||
} else {
|
||||
defer.resolve(body.access_token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user