Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

zapier convert: Add support for auth mapping templating #257

Merged
merged 1 commit into from
Mar 5, 2018

Conversation

eliangcs
Copy link
Member

@eliangcs eliangcs commented Feb 28, 2018

Fixes PDE-64.

Try zapier convert a WB app with the following auth mapping:

zapier convert currently generates the following auth middleware in index.js:

const maybeIncludeAuth = (request, z, bundle) => {
  request.headers['Authorization'] = bundle.authData['AccessKey'];

  return request;
};

which doesn't reflect the actual mapping in the WB app. This PR fixes the issue so that it generates the correct code:

const maybeIncludeAuth = (request, z, bundle) => {
  request.headers['Authorization'] = `AccessKey ${bundle.authData['AccessKey']}`;

  return request;
};

@eliangcs eliangcs requested a review from xavdid February 28, 2018 15:43
Copy link
Contributor

@xavdid xavdid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! i'm so excited about how far this has come.

@eliangcs eliangcs merged commit 9136f18 into master Mar 5, 2018
@eliangcs eliangcs deleted the convert-auth-mapping-templating branch March 5, 2018 03:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants