@mindline/sync 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/.vs/VSWorkspaceState.json +1 -1
- package/.vs/slnx.sqlite +0 -0
- package/.vs/sync/FileContentIndex/4496f952-a014-4e37-a9ec-25466d30ab72.vsidx +0 -0
- package/.vs/sync/v17/.wsuo +0 -0
- package/index.ts +37 -13
- package/package.json +1 -1
- package/.vs/sync/FileContentIndex/9530d0f7-7c01-4dbd-9d99-ef2a22cedb3d.vsidx +0 -0
package/.vs/slnx.sqlite
CHANGED
|
Binary file
|
package/.vs/sync/v17/.wsuo
CHANGED
|
Binary file
|
package/index.ts
CHANGED
|
@@ -1226,19 +1226,42 @@ export async function groupsGet(instance: IPublicClientApplication, user: User |
|
|
|
1226
1226
|
return { groups: [], error: `Exception: ${error}` };
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
export function signIn(user: User, tasks: TaskArray): void {
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1229
|
+
export async function signIn(user: User, tasks: TaskArray): void {
|
|
1230
|
+
switch (user.authority) {
|
|
1231
|
+
case graphConfig.authorityWW:
|
|
1232
|
+
// SignIn by an admin consents more permissions than Challenge which requires a consented app
|
|
1233
|
+
let tenantURL: string = window.location.href;
|
|
1234
|
+
tenantURL += "MicrosoftIdentity/Account/SignIn";
|
|
1235
|
+
let url: URL = new URL(tenantURL);
|
|
1236
|
+
url.searchParams.append("redirectUri", window.location.origin);
|
|
1237
|
+
url.searchParams.append("domainHint", "organizations");
|
|
1238
|
+
if (user.oid !== "1") {
|
|
1239
|
+
url.searchParams.append("loginHint", user.mail);
|
|
1240
|
+
}
|
|
1241
|
+
tasks.setTaskStart("initialization", new Date());
|
|
1242
|
+
tasks.setTaskStart("authenticate user", new Date());
|
|
1243
|
+
window.location.assign(url.href);
|
|
1244
|
+
break;
|
|
1245
|
+
case graphConfig.authorityUS:
|
|
1246
|
+
// retrieve controller protected by USGov authorization
|
|
1247
|
+
let usURL: string = window.location.href;
|
|
1248
|
+
usURL += "USGov";
|
|
1249
|
+
let urlUS: URL = new URL(usURL);
|
|
1250
|
+
urlUS.searchParams.append("redirectUri", window.location.origin);
|
|
1251
|
+
urlUS.searchParams.append("domainHint", user.companyDomain);
|
|
1252
|
+
if (user.oid !== "1") {
|
|
1253
|
+
urlUS.searchParams.append("loginHint", user.mail);
|
|
1254
|
+
}
|
|
1255
|
+
tasks.setTaskStart("initialization", new Date());
|
|
1256
|
+
tasks.setTaskStart("authenticate user", new Date());
|
|
1257
|
+
window.location.assign(urlUS.href);
|
|
1258
|
+
break;
|
|
1259
|
+
case graphConfig.authorityCN:
|
|
1260
|
+
// unsupported
|
|
1261
|
+
break;
|
|
1262
|
+
default:
|
|
1263
|
+
debugger;
|
|
1238
1264
|
}
|
|
1239
|
-
tasks.setTaskStart("initialization", new Date());
|
|
1240
|
-
tasks.setTaskStart("authenticate user", new Date());
|
|
1241
|
-
window.location.assign(url.href);
|
|
1242
1265
|
}
|
|
1243
1266
|
export function signInIncrementally(user: User, scope: string): void {
|
|
1244
1267
|
if (user.oid == "1") return;
|
|
@@ -1432,8 +1455,9 @@ export async function tenantRelationshipsGetById(user: User, ii: InitInfo, insta
|
|
|
1432
1455
|
//tenantUnauthenticatedLookup (from https://gettenantpartitionweb.azurewebsites.net/js/gettenantpartition.js)
|
|
1433
1456
|
export async function tenantUnauthenticatedLookup(tenant: Tenant, debug: boolean): Promise<boolean> {
|
|
1434
1457
|
if (debug) debugger;
|
|
1458
|
+
// since we should mainly be called when a user is performing a lookup, we can afford the performance hit of looking up the tenant name and domain again
|
|
1435
1459
|
// do we already have a valid tenant ID? if so, nothing to add
|
|
1436
|
-
if (tenant.tid !== "") return false;
|
|
1460
|
+
//if (tenant.tid !== "") return false;
|
|
1437
1461
|
// do we not have a valid domain? if so, nothing to lookup
|
|
1438
1462
|
if (tenant.domain == "") return false;
|
|
1439
1463
|
// prepare the 3 endpoints and corresponding regular expressions
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindline/sync",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.55",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"exports": "./index.ts",
|
|
7
7
|
"description": "sync is a node.js package encapsulating javscript classes required for configuring Mindline sync service.",
|
|
Binary file
|