diff --git a/package-lock.json b/package-lock.json index ab473eada..079a6d685 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sunbird-sdk", - "version": "2.7.19", + "version": "2.7.20", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2065,7 +2065,7 @@ }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -3297,7 +3297,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -9536,7 +9536,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -10621,7 +10621,7 @@ }, "tty-browserify": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, diff --git a/package.json b/package.json index 4efc680a5..19ff36b61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sunbird-sdk", - "version": "2.7.19", + "version": "2.7.20", "description": "Heart of the sunbird mobile app.", "main": "dist/index.js", "scripts": { diff --git a/src/auth/util/auth-util.spec.ts b/src/auth/util/auth-util.spec.ts index 66677180a..9ea6e9193 100644 --- a/src/auth/util/auth-util.spec.ts +++ b/src/auth/util/auth-util.spec.ts @@ -1,5 +1,5 @@ import {AuthUtil} from './auth-util'; -import {ApiConfig, ApiService, Response, ResponseCode, HttpServerError} from '../../api'; +import {ApiConfig, ApiService, Response, ResponseCode, HttpClientError} from '../../api'; import {anyString, anything, instance, objectContaining, reset, verify, when} from 'ts-mockito'; import {SharedPreferences} from '../../util/shared-preferences'; import {EventNamespace, EventsBusService} from '../../events-bus'; @@ -267,7 +267,7 @@ describe('AuthUtil', () => { // arrange const mockApConfig: ApiConfig = {} as Partial as ApiConfig; - const badRequestError = new HttpServerError('', (() => { + const badRequestError = new HttpClientError('', (() => { const res = new Response(); res.responseCode = ResponseCode.HTTP_BAD_REQUEST; return res; diff --git a/src/auth/util/auth-util.ts b/src/auth/util/auth-util.ts index aa7483709..1ef6561a3 100644 --- a/src/auth/util/auth-util.ts +++ b/src/auth/util/auth-util.ts @@ -1,4 +1,4 @@ -import {ApiConfig, ApiService, HttpRequestType, HttpSerializer, JWTUtil, Request, Response, ResponseCode, HttpServerError} from '../../api'; +import {ApiConfig, ApiService, HttpRequestType, HttpSerializer, JWTUtil, Request, Response, ResponseCode, HttpClientError} from '../../api'; import {OAuthSession} from '..'; import {AuthKeys} from '../../preference-keys'; import {NoActiveSessionError} from '../../profile'; @@ -36,7 +36,7 @@ export class AuthUtil { try { await this.apiService.fetch(request).toPromise() .catch((e) => { - if (e instanceof HttpServerError && e.response.responseCode === ResponseCode.HTTP_BAD_REQUEST) { + if (e instanceof HttpClientError && e.response.responseCode === ResponseCode.HTTP_BAD_REQUEST) { throw new AuthTokenRefreshError(e.message); }