login-authorization-v2 2.1.3 → 2.1.5
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/dist/index.esm.js +7 -6
- package/dist/index.umd.js +7 -6
- package/dist/src/cookie.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -42,6 +42,7 @@ const NO_MODULE_BASE_URL = 'Module base URL is required';
|
|
|
42
42
|
const INVALID_TENANT_ID = 'Invalid tenant ID';
|
|
43
43
|
const INVALID_BRAND = 'Invalid brand';
|
|
44
44
|
|
|
45
|
+
const isHttps = window.location.protocol === 'https:';
|
|
45
46
|
const makeSetCookieFn = (key, options) => {
|
|
46
47
|
const index = window.location.hostname.indexOf('.');
|
|
47
48
|
const domain = index === -1
|
|
@@ -54,12 +55,12 @@ const makeSetCookieFn = (key, options) => {
|
|
|
54
55
|
Cookie.set(key, value, Object.assign({ domain, expires: 30 }, options));
|
|
55
56
|
};
|
|
56
57
|
};
|
|
57
|
-
const setIdTokenFront = makeSetCookieFn('idTokenFront', { secure:
|
|
58
|
-
const setIdTokenBack = makeSetCookieFn('idTokenBack', { secure:
|
|
58
|
+
const setIdTokenFront = makeSetCookieFn('idTokenFront', { secure: isHttps, sameSite: 'Lax' });
|
|
59
|
+
const setIdTokenBack = makeSetCookieFn('idTokenBack', { secure: isHttps, sameSite: 'Lax' });
|
|
59
60
|
const getIdTokenFront = () => Cookie.get('idTokenFront');
|
|
60
61
|
const getIdTokenBack = () => Cookie.get('idTokenBack');
|
|
61
|
-
const setRefreshTokenFront = makeSetCookieFn('refreshTokenFront', { secure:
|
|
62
|
-
const setRefreshTokenBack = makeSetCookieFn('refreshTokenBack', { secure:
|
|
62
|
+
const setRefreshTokenFront = makeSetCookieFn('refreshTokenFront', { secure: isHttps, sameSite: 'Lax' });
|
|
63
|
+
const setRefreshTokenBack = makeSetCookieFn('refreshTokenBack', { secure: isHttps, sameSite: 'Lax' });
|
|
63
64
|
const getRefreshTokenFront = () => Cookie.get('refreshTokenFront');
|
|
64
65
|
const getRefreshTokenBack = () => Cookie.get('refreshTokenBack');
|
|
65
66
|
const setRefreshToken = (token) => {
|
|
@@ -208,7 +209,7 @@ const createPcDialog = () => {
|
|
|
208
209
|
<div style="margin: 10px 0 20px 0;color: rgb(32,33,36);font-size: 14px;">You do not have access to the system.</div>
|
|
209
210
|
<div style="display: flex;justify-content: flex-end;">
|
|
210
211
|
<button id="cancel" style="padding: 8px 15px;background: #ffffff;color:rgb(26,115,232);border:1px solid #ccc;border-radius:5px;cursor: pointer;font-size:14px;">Cancel</button>
|
|
211
|
-
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another
|
|
212
|
+
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another account</button>
|
|
212
213
|
</div>
|
|
213
214
|
</div>`;
|
|
214
215
|
};
|
|
@@ -219,7 +220,7 @@ const createMobileDialog = () => {
|
|
|
219
220
|
<div style="display: flex;justify-content: flex-end;">
|
|
220
221
|
<div style="display: flex;justify-content: flex-end;">
|
|
221
222
|
<button id="cancel" style="padding: 8px 15px;background: #ffffff;color:rgb(26,115,232);border:1px solid #ccc;border-radius:5px;cursor: pointer;font-size:14px;">Cancel</button>
|
|
222
|
-
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another
|
|
223
|
+
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another account</button>
|
|
223
224
|
</div>
|
|
224
225
|
</div>
|
|
225
226
|
</div>`;
|
package/dist/index.umd.js
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
const INVALID_TENANT_ID = 'Invalid tenant ID';
|
|
45
45
|
const INVALID_BRAND = 'Invalid brand';
|
|
46
46
|
|
|
47
|
+
const isHttps = window.location.protocol === 'https:';
|
|
47
48
|
const makeSetCookieFn = (key, options) => {
|
|
48
49
|
const index = window.location.hostname.indexOf('.');
|
|
49
50
|
const domain = index === -1
|
|
@@ -56,12 +57,12 @@
|
|
|
56
57
|
Cookie.set(key, value, Object.assign({ domain, expires: 30 }, options));
|
|
57
58
|
};
|
|
58
59
|
};
|
|
59
|
-
const setIdTokenFront = makeSetCookieFn('idTokenFront', { secure:
|
|
60
|
-
const setIdTokenBack = makeSetCookieFn('idTokenBack', { secure:
|
|
60
|
+
const setIdTokenFront = makeSetCookieFn('idTokenFront', { secure: isHttps, sameSite: 'Lax' });
|
|
61
|
+
const setIdTokenBack = makeSetCookieFn('idTokenBack', { secure: isHttps, sameSite: 'Lax' });
|
|
61
62
|
const getIdTokenFront = () => Cookie.get('idTokenFront');
|
|
62
63
|
const getIdTokenBack = () => Cookie.get('idTokenBack');
|
|
63
|
-
const setRefreshTokenFront = makeSetCookieFn('refreshTokenFront', { secure:
|
|
64
|
-
const setRefreshTokenBack = makeSetCookieFn('refreshTokenBack', { secure:
|
|
64
|
+
const setRefreshTokenFront = makeSetCookieFn('refreshTokenFront', { secure: isHttps, sameSite: 'Lax' });
|
|
65
|
+
const setRefreshTokenBack = makeSetCookieFn('refreshTokenBack', { secure: isHttps, sameSite: 'Lax' });
|
|
65
66
|
const getRefreshTokenFront = () => Cookie.get('refreshTokenFront');
|
|
66
67
|
const getRefreshTokenBack = () => Cookie.get('refreshTokenBack');
|
|
67
68
|
const setRefreshToken = (token) => {
|
|
@@ -210,7 +211,7 @@
|
|
|
210
211
|
<div style="margin: 10px 0 20px 0;color: rgb(32,33,36);font-size: 14px;">You do not have access to the system.</div>
|
|
211
212
|
<div style="display: flex;justify-content: flex-end;">
|
|
212
213
|
<button id="cancel" style="padding: 8px 15px;background: #ffffff;color:rgb(26,115,232);border:1px solid #ccc;border-radius:5px;cursor: pointer;font-size:14px;">Cancel</button>
|
|
213
|
-
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another
|
|
214
|
+
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another account</button>
|
|
214
215
|
</div>
|
|
215
216
|
</div>`;
|
|
216
217
|
};
|
|
@@ -221,7 +222,7 @@
|
|
|
221
222
|
<div style="display: flex;justify-content: flex-end;">
|
|
222
223
|
<div style="display: flex;justify-content: flex-end;">
|
|
223
224
|
<button id="cancel" style="padding: 8px 15px;background: #ffffff;color:rgb(26,115,232);border:1px solid #ccc;border-radius:5px;cursor: pointer;font-size:14px;">Cancel</button>
|
|
224
|
-
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another
|
|
225
|
+
<button id="confirm" style="padding: 8px 15px;background: rgb(26,115,232);color:#ffffff;border:none;border-radius:5px;margin-left: 10px;cursor: pointer;font-size:14px;">Sign in to another account</button>
|
|
225
226
|
</div>
|
|
226
227
|
</div>
|
|
227
228
|
</div>`;
|
package/dist/src/cookie.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../src/cookie.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GACpB,cAAc,GACZ,eAAe,GACf,cAAc,GACd,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../src/cookie.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GACpB,cAAc,GACZ,eAAe,GACf,cAAc,GACd,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,CAAA;AAkCvB,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,IAAI,SAiBnD,CAAA;AACD,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,GAAG,IAAI,SAiBlD,CAAA;AAED,eAAO,MAAM,cAAc,cAG1B,CAAA;AACD,eAAO,MAAM,eAAe,cAG3B,CAAA;AAED,eAAO,MAAM,aAAa,UArET,MAAM,GAAG,IAAI,SAqEmC,CAAA;AACjE,eAAO,MAAM,aAAa,0BAAwC,CAAA"}
|