prividium 1.5.1 → 1.6.0

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 CHANGED
@@ -269,6 +269,9 @@ interface PrividiumConfig {
269
269
  authBaseUrl: string; // Authorization service base URL
270
270
  prividiumApiBaseUrl: string; // Permissions API service base URL
271
271
  redirectUrl: string; // OAuth redirect URL
272
+ org?: string; // Local development/testing only: selects an organization so the auth popup shows that
273
+ // org's branding and routes login to its identity provider. In production the organization is
274
+ // determined by the deployment address (subdomain) and this value is ignored. (optional)
272
275
  storage?: Storage; // Custom storage implementation (optional)
273
276
  onAuthExpiry?: () => void; // Called when authentication expires (optional)
274
277
  }
@@ -5,6 +5,7 @@ export interface PopupAuthConfig {
5
5
  authBaseUrl: string;
6
6
  clientId: string;
7
7
  redirectUri: string;
8
+ org?: string;
8
9
  tokenManager: TokenManager;
9
10
  }
10
11
  export declare class PopupAuth {
@@ -123,6 +123,9 @@ export class PopupAuth {
123
123
  url.searchParams.set('redirect_uri', this.config.redirectUri);
124
124
  url.searchParams.set('state', state);
125
125
  url.searchParams.set('response_type', 'token');
126
+ if (this.config.org) {
127
+ url.searchParams.set('org', this.config.org);
128
+ }
126
129
  if (scopes?.length) {
127
130
  for (const scope of scopes) {
128
131
  url.searchParams.append('scope', scope);
@@ -14,6 +14,7 @@ export function createPrividiumChain(config) {
14
14
  clientId: config.clientId,
15
15
  authBaseUrl: config.authBaseUrl,
16
16
  redirectUri: config.redirectUrl,
17
+ org: config.org,
17
18
  tokenManager
18
19
  });
19
20
  const getAuthHeaders = () => {
@@ -11,6 +11,13 @@ export interface PrividiumConfig {
11
11
  chain: Omit<Chain, 'rpcUrls'>;
12
12
  authBaseUrl: string;
13
13
  redirectUrl: string;
14
+ /**
15
+ * Local development/testing only. Selects an organization so the auth popup shows that
16
+ * organization's branding and routes login to its identity provider (forwarded to the User
17
+ * Panel as `?org=<id>`). In production the organization is determined by the deployment
18
+ * address (subdomain) and this value is ignored.
19
+ */
20
+ org?: string;
14
21
  /**
15
22
  * @deprecated use the `prividiumApiBaseUrl` field instead
16
23
  */