Skip to content

Commit

Permalink
Issue #SB-000 merge: Merge pull request #313 from swayangjit/release-…
Browse files Browse the repository at this point in the history
…2.7.0

Issue #SB-000 chore: Added fix for logout event not firing when 400 response code is received.
  • Loading branch information
swayangjit committed Mar 6, 2020
2 parents 9fa56dc + 6236bc6 commit 19a6c37
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/auth/util/auth-util.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('AuthUtil', () => {
// arrange
const mockApConfig: ApiConfig = {} as Partial<ApiConfig> as ApiConfig;

const badRequestError = new HttpServerError('', (() => {
const badRequestError = new HttpClientError('', (() => {
const res = new Response();
res.responseCode = ResponseCode.HTTP_BAD_REQUEST;
return res;
Expand Down
4 changes: 2 additions & 2 deletions src/auth/util/auth-util.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 19a6c37

Please sign in to comment.