Skip to content

Commit

Permalink
v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Feb 6, 2024
1 parent e861b6e commit 3a872c2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dist/bud-provider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ declare function BudProvider(this: any, options: FullBudProviderOptions): {
when: number;
refreshToken: any;
accessToken: any;
tokenState: "active";
config: any;
}>;
getGateway: (spec: {
redirect_url: string;
Expand Down
6 changes: 6 additions & 0 deletions dist/bud-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/bud-provider.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seneca/bud-provider",
"version": "0.9.0",
"version": "0.10.0",
"main": "dist/bud-provider.js",
"type": "commonjs",
"types": "dist/bud-provider.d.ts",
Expand Down
10 changes: 9 additions & 1 deletion src/bud-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,22 @@ function BudProvider(this: any, options: FullBudProviderOptions) {
}



async function loadTokens() {
refreshToken = await options.store.loadToken('refresh')
accessToken = await options.store.loadToken('access')

let authContent = 'Bearer ' + accessToken
config.headers['Authorization'] = authContent
config.headers['X-Client-Id'] = seneca.shared.clientid

tokenState = 'active'

return {
when: Date.now(),
refreshToken,
accessToken,
tokenState,
config,
}
}

Expand Down

0 comments on commit 3a872c2

Please sign in to comment.