Skip to content

Commit

Permalink
fix: Update dependencies and fix type issues. (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeldiRium committed Feb 1, 2022
1 parent bdffe1e commit 7d26816
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 54 deletions.
20 changes: 14 additions & 6 deletions lib/Limes.ts
@@ -1,8 +1,8 @@
import { Claims } from './Claims';
import { flaschenpost } from 'flaschenpost';
import { IdentityProvider } from './IdentityProvider';
import jwt from 'jsonwebtoken';
import { RequestHandler } from 'express';
import jwt, { VerifyErrors } from 'jsonwebtoken';

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
Expand Down Expand Up @@ -135,7 +135,7 @@ class Limes {
algorithms: [ 'RS256' ],
issuer: identityProvider.issuer
},
(err: VerifyErrors | null, verifiedToken: Record<string, any> | undefined): void => {
(err, verifiedToken): void => {
if (err) {
this.logger.error(err.message);

Expand Down Expand Up @@ -178,7 +178,9 @@ class Limes {
authorizationQuery = req.query.token;

if (typeof authorizationQuery !== 'string' && typeof authorizationQuery !== 'undefined') {
return res.status(400).end();
res.status(400).end();

return;
}

if (authorizationHeader) {
Expand All @@ -201,7 +203,9 @@ class Limes {
this.logger.error(ex.message);
}

return res.status(401).end();
res.status(401).end();

return;
}
} else {
const payload = {
Expand All @@ -216,7 +220,9 @@ class Limes {
subject += `-${req.headers['x-anonymous-id']}`;
} else if (anonymousId) {
if (typeof anonymousId !== 'string') {
return res.status(400).end();
res.status(400).end();

return;
}

subject += `-${anonymousId}`;
Expand All @@ -232,7 +238,9 @@ class Limes {
if (!decodedToken) {
this.logger.error('Failed to verify token.');

return res.status(400).end();
res.status(400).end();

return;
}

/* eslint-disable no-param-reassign */
Expand Down
93 changes: 47 additions & 46 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -25,15 +25,15 @@
"types": "build/lib/Limes.d.ts",
"dependencies": {
"@types/express": "4.17.13",
"@types/jsonwebtoken": "8.5.6",
"@types/jsonwebtoken": "8.5.8",
"jsonwebtoken": "8.5.1"
},
"devDependencies": {
"@types/supertest": "2.0.11",
"@types/uuid": "8.3.4",
"assertthat": "6.4.0",
"express": "4.17.2",
"flaschenpost": "5.0.49",
"flaschenpost": "5.0.50",
"roboter": "12.6.5",
"semantic-release-configuration": "2.0.7",
"supertest": "6.2.2",
Expand Down

0 comments on commit 7d26816

Please sign in to comment.