@ave-id/embed 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/embed.js +18 -0
  2. package/package.json +1 -1
package/dist/embed.js CHANGED
@@ -79,6 +79,8 @@ export function openAveSheet({
79
79
  scope = "openid profile email",
80
80
  issuer = "https://aveid.net",
81
81
  theme = DEFAULT_THEME,
82
+ codeChallenge,
83
+ codeChallengeMethod,
82
84
  onSuccess,
83
85
  onError,
84
86
  onClose,
@@ -148,6 +150,13 @@ export function openAveSheet({
148
150
  embed: "1",
149
151
  theme,
150
152
  });
153
+
154
+ if (codeChallenge) {
155
+ params.set("code_challenge", codeChallenge);
156
+ }
157
+ if (codeChallengeMethod) {
158
+ params.set("code_challenge_method", codeChallengeMethod);
159
+ }
151
160
 
152
161
  iframe.src = `${issuer}/signin?${params.toString()}`;
153
162
  iframe.style.cssText = `
@@ -240,6 +249,8 @@ export function openAvePopup({
240
249
  redirectUri,
241
250
  scope = "openid profile email",
242
251
  issuer = "https://aveid.net",
252
+ codeChallenge,
253
+ codeChallengeMethod,
243
254
  width = 450,
244
255
  height = 650,
245
256
  onSuccess,
@@ -252,6 +263,13 @@ export function openAvePopup({
252
263
  scope,
253
264
  embed: "1",
254
265
  });
266
+
267
+ if (codeChallenge) {
268
+ params.set("code_challenge", codeChallenge);
269
+ }
270
+ if (codeChallengeMethod) {
271
+ params.set("code_challenge_method", codeChallengeMethod);
272
+ }
255
273
 
256
274
  const left = (window.innerWidth - width) / 2 + window.screenX;
257
275
  const top = (window.innerHeight - height) / 2 + window.screenY;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ave-id/embed",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "main": "dist/embed.js",
6
6
  "module": "dist/embed.js",