Give correct error if appstore login requires 2fa

This commit is contained in:
Johannes Zellner
2023-01-27 12:15:03 +01:00
parent 2b260c873f
commit 016e0e8809
+1 -1
View File
@@ -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}`);