Skip to content

Commit

Permalink
fix: correctly apply mergeWithLastSubmission for interactionFinished
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 28, 2019
1 parent 0aa4e1c commit eb67723
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/routes/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ module.exports = (app, provider) => {
const account = await Account.findByLogin(req.body.login);

const result = {
select_account: {}, // make sure its skipped by the interaction policy since we just logged in
login: {
account: account.accountId,
ts: Math.floor(Date.now() / 1000),
Expand Down
2 changes: 2 additions & 0 deletions example/routes/koa.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module.exports = (provider) => {
const account = await Account.findByLogin(ctx.request.body.login);

const result = {
select_account: {}, // make sure its skipped by the interaction policy since we just logged in
login: {
account: account.accountId,
ts: Math.floor(Date.now() / 1000),
Expand Down Expand Up @@ -149,6 +150,7 @@ module.exports = (provider) => {
const account = await Account.findByFederated('google', tokenset.claims());

const result = {
select_account: {}, // make sure its skipped by the interaction policy since we just logged in
login: {
account: account.accountId,
ts: Math.floor(Date.now() / 1000),
Expand Down
2 changes: 1 addition & 1 deletion lib/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class Provider extends events.EventEmitter {
* @api public
*/
async interactionFinished(req, res, result, { mergeWithLastSubmission = true } = {}) {
const returnTo = await this.interactionResult(req, res, result, mergeWithLastSubmission);
const returnTo = await this.interactionResult(req, res, result, { mergeWithLastSubmission });

res.statusCode = 302; // eslint-disable-line no-param-reassign
res.setHeader('Location', returnTo);
Expand Down

0 comments on commit eb67723

Please sign in to comment.