@feathersjs/authentication
Advanced tools
Comparing version 4.5.11 to 4.5.12
@@ -22,3 +22,3 @@ "use strict"; | ||
const options_1 = __importDefault(require("./options")); | ||
const debug = debug_1.default('@feathersjs/authentication/base'); | ||
const debug = (0, debug_1.default)('@feathersjs/authentication/base'); | ||
/** | ||
@@ -42,3 +42,3 @@ * A base class for managing authentication strategies and creating and verifying JWTs | ||
app.set('defaultAuthentication', app.get('defaultAuthentication') || configKey); | ||
app.set(configKey, merge_1.default({}, app.get(configKey), options)); | ||
app.set(configKey, (0, merge_1.default)({}, app.get(configKey), options)); | ||
} | ||
@@ -100,6 +100,6 @@ /** | ||
// Default jwt options merged with additional options | ||
const options = merge_1.default({}, jwtOptions, optsOverride); | ||
const options = (0, merge_1.default)({}, jwtOptions, optsOverride); | ||
if (!options.jwtid) { | ||
// Generate a UUID as JWT ID by default | ||
options.jwtid = uuid_1.v4(); | ||
options.jwtid = (0, uuid_1.v4)(); | ||
} | ||
@@ -119,3 +119,3 @@ return jsonwebtoken_1.default.sign(payload, jwtSecret, options); | ||
const jwtSecret = secretOverride || secret; | ||
const options = merge_1.default({}, jwtOptions, optsOverride); | ||
const options = (0, merge_1.default)({}, jwtOptions, optsOverride); | ||
const { algorithm } = options; | ||
@@ -122,0 +122,0 @@ // Normalize the `algorithm` setting into the algorithms array |
@@ -19,6 +19,6 @@ "use strict"; | ||
const debug_1 = __importDefault(require("debug")); | ||
const debug = debug_1.default('@feathersjs/authentication/hooks/authenticate'); | ||
const debug = (0, debug_1.default)('@feathersjs/authentication/hooks/authenticate'); | ||
exports.default = (originalSettings, ...originalStrategies) => { | ||
const settings = typeof originalSettings === 'string' | ||
? { strategies: flatten_1.default([originalSettings, ...originalStrategies]) } | ||
? { strategies: (0, flatten_1.default)([originalSettings, ...originalStrategies]) } | ||
: originalSettings; | ||
@@ -48,6 +48,6 @@ if (!originalSettings || settings.strategies.length === 0) { | ||
if (authentication) { | ||
const authParams = omit_1.default(params, 'provider', 'authentication'); | ||
const authParams = (0, omit_1.default)(params, 'provider', 'authentication'); | ||
debug('Authenticating with', authentication, strategies); | ||
const authResult = yield authService.authenticate(authentication, authParams, ...strategies); | ||
context.params = Object.assign({}, params, omit_1.default(authResult, 'accessToken'), { authenticated: true }); | ||
context.params = Object.assign({}, params, (0, omit_1.default)(authResult, 'accessToken'), { authenticated: true }); | ||
return context; | ||
@@ -54,0 +54,0 @@ } |
@@ -22,3 +22,3 @@ "use strict"; | ||
const service = context.service; | ||
Object.assign(connection, omit_1.default(result, 'accessToken', 'authentication')); | ||
Object.assign(connection, (0, omit_1.default)(result, 'accessToken', 'authentication')); | ||
yield service.handleConnection(event, connection, result); | ||
@@ -25,0 +25,0 @@ return context; |
@@ -16,3 +16,3 @@ "use strict"; | ||
const debug_1 = __importDefault(require("debug")); | ||
const debug = debug_1.default('@feathersjs/authentication/hooks/connection'); | ||
const debug = (0, debug_1.default)('@feathersjs/authentication/hooks/connection'); | ||
exports.default = (event) => (context) => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -19,0 +19,0 @@ const { app, result, params } = context; |
@@ -22,3 +22,3 @@ "use strict"; | ||
const strategy_1 = require("./strategy"); | ||
const debug = debug_1.default('@feathersjs/authentication/jwt'); | ||
const debug = (0, debug_1.default)('@feathersjs/authentication/jwt'); | ||
const SPLIT_HEADER = /(\S+)\s+(\S+)/; | ||
@@ -97,3 +97,3 @@ class JWTStrategy extends strategy_1.AuthenticationBaseStrategy { | ||
const query = yield this.getEntityQuery(params); | ||
const getParams = Object.assign({}, omit_1.default(params, 'provider'), { query }); | ||
const getParams = Object.assign({}, (0, omit_1.default)(params, 'provider'), { query }); | ||
const result = yield entityService.get(id, getParams); | ||
@@ -100,0 +100,0 @@ if (!params.provider) { |
@@ -23,3 +23,3 @@ "use strict"; | ||
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); | ||
const debug = debug_1.default('@feathersjs/authentication/service'); | ||
const debug = (0, debug_1.default)('@feathersjs/authentication/service'); | ||
class AuthenticationService extends core_1.AuthenticationBase { | ||
@@ -58,3 +58,3 @@ constructor(app, configKey = 'authentication', options = {}) { | ||
const { service, entity, entityId } = this.configuration; | ||
const jwtOptions = merge_1.default({}, params.jwtOptions, params.jwt); | ||
const jwtOptions = (0, merge_1.default)({}, params.jwtOptions, params.jwt); | ||
const value = service && entity && authResult[entity]; | ||
@@ -96,3 +96,3 @@ // Set the subject to the entity id if it is available | ||
const accessToken = yield this.createAccessToken(payload, jwtOptions, params.secret); | ||
return merge_1.default({ accessToken }, authResult, { | ||
return (0, merge_1.default)({ accessToken }, authResult, { | ||
authentication: { | ||
@@ -146,4 +146,4 @@ accessToken, | ||
after: { | ||
create: [hooks_1.connection('login'), hooks_1.event('login')], | ||
remove: [hooks_1.connection('logout'), hooks_1.event('logout')] | ||
create: [(0, hooks_1.connection)('login'), (0, hooks_1.event)('login')], | ||
remove: [(0, hooks_1.connection)('logout'), (0, hooks_1.event)('logout')] | ||
} | ||
@@ -150,0 +150,0 @@ }); |
{ | ||
"name": "@feathersjs/authentication", | ||
"description": "Add Authentication to your FeathersJS app.", | ||
"version": "4.5.11", | ||
"version": "4.5.12", | ||
"homepage": "https://feathersjs.com", | ||
@@ -55,25 +55,25 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/errors": "^4.5.11", | ||
"@feathersjs/feathers": "^4.5.11", | ||
"@feathersjs/transport-commons": "^4.5.11", | ||
"@types/jsonwebtoken": "^8.5.0", | ||
"debug": "^4.3.1", | ||
"@feathersjs/errors": "^4.5.12", | ||
"@feathersjs/feathers": "^4.5.12", | ||
"@feathersjs/transport-commons": "^4.5.12", | ||
"@types/jsonwebtoken": "^8.5.6", | ||
"debug": "^4.3.3", | ||
"jsonwebtoken": "^8.5.1", | ||
"lodash": "^4.17.20", | ||
"lodash": "^4.17.21", | ||
"long-timeout": "^0.1.1", | ||
"uuid": "^8.3.1" | ||
"uuid": "^8.3.2" | ||
}, | ||
"devDependencies": { | ||
"@types/debug": "^4.1.5", | ||
"@types/lodash": "^4.14.165", | ||
"@types/mocha": "^8.0.4", | ||
"@types/node": "^14.14.10", | ||
"@types/uuid": "^8.3.0", | ||
"@types/debug": "^4.1.7", | ||
"@types/lodash": "^4.14.178", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^17.0.8", | ||
"@types/uuid": "^8.3.3", | ||
"feathers-memory": "^4.1.0", | ||
"mocha": "^8.2.1", | ||
"mocha": "^9.1.3", | ||
"shx": "^0.3.3", | ||
"ts-node": "^9.1.0", | ||
"typescript": "^4.1.2" | ||
"ts-node": "^10.4.0", | ||
"typescript": "^4.5.4" | ||
}, | ||
"gitHead": "de0526849eb36ab6ef19ef1764e0d9e0a6ccbd81" | ||
"gitHead": "8697ecc85808437e9aab63e5d2327679340c5401" | ||
} |
@@ -193,3 +193,3 @@ import merge from 'lodash/merge'; | ||
return verified as any; | ||
} catch (error) { | ||
} catch (error: any) { | ||
throw new NotAuthenticated(error.message, error); | ||
@@ -196,0 +196,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
192152
Updated@feathersjs/errors@^4.5.12
Updated@feathersjs/feathers@^4.5.12
Updated@types/jsonwebtoken@^8.5.6
Updateddebug@^4.3.3
Updatedlodash@^4.17.21
Updateduuid@^8.3.2