mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 07:10:53 +00:00
lint fixes
This commit is contained in:
parent
f2c6321216
commit
4b0b91396b
@ -17,13 +17,15 @@ export default class BearerTokenAuthorization {
|
||||
try {
|
||||
req = req as OneUptimeRequest;
|
||||
|
||||
if (req.headers?.['authorization'] || req.headers?.['Authorization']) {
|
||||
if (
|
||||
req.headers?.['authorization'] ||
|
||||
req.headers?.['Authorization']
|
||||
) {
|
||||
let token: string | undefined | Array<string> =
|
||||
req.headers['authorization'] ||
|
||||
req.headers['Authorization'];
|
||||
token = token?.toString().replace('Bearer ', '');
|
||||
if (token) {
|
||||
|
||||
const tokenData: JSONObject =
|
||||
JSONWebToken.decodeJsonPayload(token);
|
||||
|
||||
@ -33,7 +35,9 @@ export default class BearerTokenAuthorization {
|
||||
}
|
||||
}
|
||||
|
||||
throw new NotAuthorizedException('Invalid bearer token, or bearer token not provided.');
|
||||
throw new NotAuthorizedException(
|
||||
'Invalid bearer token, or bearer token not provided.'
|
||||
);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user