-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathutils.ts
More file actions
30 lines (25 loc) · 1.17 KB
/
utils.ts
File metadata and controls
30 lines (25 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Authorization
*/
/**
* Returns the IMS authority URL.
* A prefix will be prepended based on the value of the IMJS_URL_PREFIX environment variable.
* The prefix "dev-" will automatically be converted to "qa-".
* @deprecated in 1.1.0. Please set the authority in `BrowserAuthorizationClientConfiguration` configuration object.
*/
export function getImsAuthority(): string {
try {
let prefix = process.env.IMJS_URL_PREFIX;
console.warn("getImsAuthority", "use of process.env.IMJS_URL_PREFIX is deprecated. Please set the authority in `BrowserAuthorizationClientConfiguration` configuration object."); // eslint-disable-line no-console
if (prefix === "dev-")
prefix = "qa-";
return `https://${prefix}ims.bentley.com`;
} catch {
// swallow error
}
return "https://ims.bentley.com";
}