Give correct error if appstore login requires 2fa
This commit is contained in:
+1
-1
@@ -88,7 +88,7 @@ async function login(email, password, totpToken) {
|
||||
.ok(() => true));
|
||||
|
||||
if (error) throw new BoxError(BoxError.NETWORK_ERROR, error.message);
|
||||
if (response.status === 401) throw new BoxError(BoxError.INVALID_CREDENTIALS);
|
||||
if (response.status === 401) throw new BoxError(BoxError.INVALID_CREDENTIALS, response.body.message);
|
||||
if (response.status !== 200) throw new BoxError(BoxError.EXTERNAL_ERROR, `Login error. status code: ${response.status}`);
|
||||
if (!response.body.accessToken) throw new BoxError(BoxError.EXTERNAL_ERROR, `Login error. invalid response: ${response.text}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user