mitra-interactions-sdk 1.0.53 → 1.0.55
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 +34 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -58,7 +58,8 @@ function autoConfigureFromLogin(response, authUrl, projectId) {
|
|
|
58
58
|
}
|
|
59
59
|
function buildAuthUrl(authUrl, method, projectId, opts) {
|
|
60
60
|
const base = authUrl.endsWith("/") ? authUrl : authUrl + "/";
|
|
61
|
-
|
|
61
|
+
const separator = base.includes("?") ? "&" : "?";
|
|
62
|
+
let url = `${base}${separator}method=${method}&projectId=${encodeURIComponent(projectId)}`;
|
|
62
63
|
if (opts == null ? void 0 : opts.returnTo) url += `&returnTo=${encodeURIComponent(opts.returnTo)}`;
|
|
63
64
|
if (opts == null ? void 0 : opts.create) url += `&create=true`;
|
|
64
65
|
if (opts == null ? void 0 : opts.title) url += `&title=${encodeURIComponent(opts.title)}`;
|
|
@@ -167,7 +168,8 @@ function openSilentAuthIframe(authUrl, projectId, credentials) {
|
|
|
167
168
|
return new Promise((resolve, reject) => {
|
|
168
169
|
const origin = getOriginFromUrl(authUrl);
|
|
169
170
|
const base = authUrl.endsWith("/") ? authUrl : authUrl + "/";
|
|
170
|
-
|
|
171
|
+
const separator = base.includes("?") ? "&" : "?";
|
|
172
|
+
let url = `${base}${separator}mode=silent&projectId=${encodeURIComponent(projectId)}`;
|
|
171
173
|
if (typeof window !== "undefined") {
|
|
172
174
|
url += `&originUrl=${encodeURIComponent(window.location.href)}`;
|
|
173
175
|
}
|