@muze-nl/metro-oidc 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,8 +42,11 @@ The metro oidc middleware doesn't use the id_token, or verify any of its content
42
42
  ```javascript
43
43
  import oidc from '@muze-nl/metro-oidc'
44
44
 
45
- let id_token = oidc.idToken()
45
+ let id_token = oidc.idToken({issuer:"oidc issuer url"})
46
46
  ```
47
47
 
48
+ `idToken()` expects either the store or the issuer option that you passed on to the `oidcmw()` function.
49
+
50
+
48
51
  [project-stage-badge: Experimental]: https://img.shields.io/badge/Project%20Stage-Experimental-yellow.svg
49
52
  [project-stage-page]: https://blog.pother.ca/project-stages/
package/dist/browser.js CHANGED
@@ -20,10 +20,10 @@
20
20
  });
21
21
  var metroURL = "https://metro.muze.nl/details/";
22
22
  if (!Symbol.metroProxy) {
23
- Symbol.metroProxy = Symbol("isProxy");
23
+ Symbol.metroProxy = /* @__PURE__ */ Symbol("isProxy");
24
24
  }
25
25
  if (!Symbol.metroSource) {
26
- Symbol.metroSource = Symbol("source");
26
+ Symbol.metroSource = /* @__PURE__ */ Symbol("source");
27
27
  }
28
28
  var Client = class _Client {
29
29
  clientOptions = {
@@ -111,7 +111,7 @@
111
111
  options = Object.assign({}, this.clientOptions, options);
112
112
  let next;
113
113
  for (let middleware of middlewares) {
114
- next = /* @__PURE__ */ function(next2, middleware2) {
114
+ next = /* @__PURE__ */ (function(next2, middleware2) {
115
115
  return async function(req2) {
116
116
  let res;
117
117
  let tracers = Object.values(_Client.tracers);
@@ -128,7 +128,7 @@
128
128
  }
129
129
  return res;
130
130
  };
131
- }(next, middleware);
131
+ })(next, middleware);
132
132
  }
133
133
  return next(req);
134
134
  }
@@ -1173,7 +1173,8 @@
1173
1173
  case "client_credentials":
1174
1174
  break;
1175
1175
  case "refresh_token":
1176
- params2.refresh_token = oauth2.refresh_token;
1176
+ const refreshToken = options.tokens.get("refresh_token");
1177
+ params2.refresh_token = refreshToken.value;
1177
1178
  break;
1178
1179
  default:
1179
1180
  throw new Error("Unknown grant_type: ".oauth2.grant_type);