integreat-io / integreat

Node.js integration layer
Other
14 stars 3 forks source link

Allow auth config to override transporter get authentication method #249

Closed kjellmorten closed 1 year ago

kjellmorten commented 1 year ago

A transporter has an authentication prop that tells Integreat which method on the authenticator to use for retrieving the auth object when sending it to the transporter. Sometimes, however, we need to use another method for certain setups, e.g. when the transporter expects http headers, but we'll include the credentials in the request body through mutations instead. Thus, the auth config should have a authenticationMethod prop to override the default from the transporter.

kjellmorten commented 1 year ago

Implemented with the prop overrideAuthAsMethod on the auth definition. This goes well with new alias defaultAuthAsMethod on the transporter (alias of authentication).