X-Git-Url: http://git.squeep.com/?p=squeep-indie-auther;a=blobdiff_plain;f=src%2Fmanager.js;fp=src%2Fmanager.js;h=c7fe0df1b8d73f135e8a1d3f953f64b99df4e1cc;hp=c79c7529670b8b83dba45f55ccb824716bd427c6;hb=e8dccf76ec2776f07eddd1ce2f1c4fc150a6f790;hpb=4a8977142d1f54e168f6cc7b229133863fcf0dba diff --git a/src/manager.js b/src/manager.js index c79c752..c7fe0df 100644 --- a/src/manager.js +++ b/src/manager.js @@ -196,9 +196,10 @@ class Manager { Manager._sensitiveResponse(res); - ctx.session = Object.assign({}, ctx.session, { + ctx.session = { + ...ctx.session, errorDescriptions: [], - }); + }; // Ingest and validate expected data, populating ctx.session. await this._clientIdRequired(ctx); @@ -633,7 +634,9 @@ class Manager { Manager._sensitiveResponse(res); // Ensure session exists, persisting any login session data. - ctx.session = Object.assign({}, ctx.session); + ctx.session = { + ...ctx.session, + }; try { // Recover the session established on initial auth request. const oldSession = await this.mysteryBox.unpack(ctx.parsedBody['session']); @@ -789,9 +792,10 @@ class Manager { async _ingestPostAuthorizationRequest(ctx) { const _scope = _fileScope('_ingestPostAuthorizationRequest'); - ctx.session = Object.assign({}, ctx.session, { + ctx.session = { + ...ctx.session, errorDescriptions: [], - }); + }; if (!ctx.parsedBody) { this.logger.debug(_scope, 'no body data', { ctx }); @@ -1397,7 +1401,9 @@ class Manager { const _scope = _fileScope('postToken'); this.logger.debug(_scope, 'called', { ctx }); - ctx.session = Object.assign({}, ctx.session); + ctx.session = { + ...ctx.session, + }; await this.db.context(async (dbCtx) => {