cleanup: typos and remove commented out code (#36573)

This commit is contained in:
xyozio
2019-08-09 21:27:26 +03:00
committed by mrugesh
parent 5db1f0d4c4
commit 657a5e2c16
6 changed files with 7 additions and 16 deletions

View File

@ -105,7 +105,7 @@ describe('request-authorization', () => {
const next = sinon.spy();
expect(() => requestAuthorization(req, res, next)).toThrowError(
'Access token is no longer vaild'
'Access token is no longer valid'
);
expect(next.called).toBe(false);
});
@ -192,7 +192,7 @@ describe('request-authorization', () => {
const next = sinon.spy();
expect(() => requestAuthorization(req, res, next)).toThrowError(
'Access token is no longer vaild'
'Access token is no longer valid'
);
expect(next.called).toBe(false);
});

View File

@ -51,10 +51,10 @@ export default ({ jwtSecret = _jwtSecret, getUserById = _getUserById } = {}) =>
});
}
if (!accessToken && error === errorTypes.expiredToken) {
throw wrapHandledError(new Error('Access token is no longer vaild'), {
throw wrapHandledError(new Error('Access token is no longer valid'), {
type: 'info',
redirect: `${homeLocation}/signin`,
message: 'Access token is no longer vaild',
message: 'Access token is no longer valid',
status: 403
});
}