Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Oct 19, 2023
1 parent 6daf3d6 commit e28059a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions dist/ovationincentives-provider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ type OvationProviderOptions = {
url: string;
authurl: string;
proxyurl: string;
proxysecret: string;
fetch: any;
debug: boolean;
live: boolean;
Expand Down
5 changes: 4 additions & 1 deletion dist/ovationincentives-provider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ovationincentives-provider.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seneca/ovationincentives-provider",
"version": "0.2.0",
"version": "0.3.0",
"main": "dist/ovationincentives-provider.js",
"type": "commonjs",
"types": "dist/ovationincentives-provider.d.ts",
Expand Down
6 changes: 5 additions & 1 deletion src/ovationincentives-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type OvationProviderOptions = {
url: string
authurl: string
proxyurl: string
proxysecret: string
fetch: any
debug: boolean
live: boolean
Expand Down Expand Up @@ -88,6 +89,7 @@ function OvationProvider(this: any, options: OvationProviderOptions) {
headers: {
'Content-Type': 'application/json',
'x-ovationincentives-proxy-url': url,
'x-ovationincentives-proxy-secret': options.proxysecret,
}
},)

Expand Down Expand Up @@ -138,7 +140,8 @@ function OvationProvider(this: any, options: OvationProviderOptions) {
headers: {
Authorization: seneca.shared.headers.Authorization,
'Content-Type': 'application/x-www-form-urlencoded',
'x-ovationincentives-proxy-url': options.authurl
'x-ovationincentives-proxy-url': options.authurl,
'x-ovationincentives-proxy-secret': options.proxysecret,
},
body: `grant_type=client_credentials&scope=` + (options.live ? `ovation_api` : `ovation_sandbox`)
}
Expand Down Expand Up @@ -239,6 +242,7 @@ const defaults: OvationProviderOptions = {
authurl: 'https://auth.ovationincentives.com/connect/token',

proxyurl: '',
proxysecret: '',

// Use global fetch by default - if exists
fetch: ('undefined' === typeof fetch ? undefined : fetch),
Expand Down

0 comments on commit e28059a

Please sign in to comment.