@auth0/auth0-spa-js 2.8.0 → 2.9.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 +1 -1
- package/dist/auth0-spa-js.development.js +3 -2
- package/dist/auth0-spa-js.development.js.map +1 -1
- package/dist/auth0-spa-js.production.esm.js +1 -1
- package/dist/auth0-spa-js.production.esm.js.map +1 -1
- package/dist/auth0-spa-js.production.js +1 -1
- package/dist/auth0-spa-js.production.js.map +1 -1
- package/dist/lib/auth0-spa-js.cjs.js +3 -2
- package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
- package/dist/typings/Auth0Client.d.ts +3 -0
- package/dist/typings/MyAccountApiClient.d.ts +2 -2
- package/dist/typings/global.d.ts +6 -6
- package/dist/typings/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/Auth0Client.ts +5 -0
- package/src/MyAccountApiClient.ts +2 -2
- package/src/global.ts +8 -7
- package/src/version.ts +1 -1
|
@@ -305,9 +305,12 @@ export declare class Auth0Client {
|
|
|
305
305
|
* Initiates a redirect to connect the user's account with a specified connection.
|
|
306
306
|
* This method generates PKCE parameters, creates a transaction, and redirects to the /connect endpoint.
|
|
307
307
|
*
|
|
308
|
+
* You must enable `Offline Access` from the Connection Permissions settings to be able to use the connection with Connected Accounts.
|
|
309
|
+
*
|
|
308
310
|
* @template TAppState - The application state to persist through the transaction.
|
|
309
311
|
* @param {RedirectConnectAccountOptions<TAppState>} options - Options for the connect account redirect flow.
|
|
310
312
|
* @param {string} options.connection - The name of the connection to link (e.g. 'google-oauth2').
|
|
313
|
+
* @param {string[]} [options.scopes] - Array of scopes to request from the Identity Provider during the connect account flow.
|
|
311
314
|
* @param {AuthorizationParams} [options.authorization_params] - Additional authorization parameters for the request to the upstream IdP.
|
|
312
315
|
* @param {string} [options.redirectUri] - The URI to redirect back to after connecting the account.
|
|
313
316
|
* @param {TAppState} [options.appState] - Application state to persist through the transaction.
|
|
@@ -3,12 +3,12 @@ import { Fetcher } from './fetcher';
|
|
|
3
3
|
interface ConnectRequest {
|
|
4
4
|
/** The name of the connection to link the account with (e.g., 'google-oauth2', 'facebook'). */
|
|
5
5
|
connection: string;
|
|
6
|
+
/** Array of scopes to request from the Identity Provider during the connect account flow. */
|
|
7
|
+
scopes?: string[];
|
|
6
8
|
/** The URI to redirect to after the connection process completes. */
|
|
7
9
|
redirect_uri: string;
|
|
8
10
|
/** An opaque value used to maintain state between the request and callback. */
|
|
9
11
|
state?: string;
|
|
10
|
-
/** A string value used to associate a Client session with an ID Token, and to mitigate replay attacks. */
|
|
11
|
-
nonce?: string;
|
|
12
12
|
/** The PKCE code challenge derived from the code verifier. */
|
|
13
13
|
code_challenge?: string;
|
|
14
14
|
/** The method used to derive the code challenge. Required when code_challenge is provided. */
|
package/dist/typings/global.d.ts
CHANGED
|
@@ -497,22 +497,22 @@ export interface RedirectConnectAccountOptions<TAppState = any> {
|
|
|
497
497
|
*/
|
|
498
498
|
connection: string;
|
|
499
499
|
/**
|
|
500
|
-
*
|
|
500
|
+
* Array of scopes to request from the Identity Provider during the connect account flow.
|
|
501
501
|
*
|
|
502
502
|
* @example
|
|
503
503
|
* await auth0.connectAccountWithRedirect({
|
|
504
504
|
* connection: 'google-oauth2',
|
|
505
|
-
*
|
|
506
|
-
* scope: 'https://www.googleapis.com/auth/calendar'
|
|
507
|
-
* access_type: 'offline'
|
|
508
|
-
* }
|
|
505
|
+
* scopes: ['https://www.googleapis.com/auth/calendar']
|
|
509
506
|
* });
|
|
507
|
+
*/
|
|
508
|
+
scopes?: string[];
|
|
509
|
+
/**
|
|
510
|
+
* Additional authorization parameters for the request.
|
|
510
511
|
*
|
|
511
512
|
* @example
|
|
512
513
|
* await auth0.connectAccountWithRedirect({
|
|
513
514
|
* connection: 'github',
|
|
514
515
|
* authorization_params: {
|
|
515
|
-
* scope: 'repo user',
|
|
516
516
|
* audience: 'https://api.github.com'
|
|
517
517
|
* }
|
|
518
518
|
* });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.
|
|
1
|
+
declare const _default: "2.9.0";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "@auth0/auth0-spa-js",
|
|
4
4
|
"description": "Auth0 SDK for Single Page Applications using Authorization Code Grant Flow with PKCE",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.9.0",
|
|
7
7
|
"main": "dist/lib/auth0-spa-js.cjs.js",
|
|
8
8
|
"types": "dist/typings/index.d.ts",
|
|
9
9
|
"module": "dist/auth0-spa-js.production.esm.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"publish:cdn": "ccu --trace"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@auth0/component-cdn-uploader": "^2.
|
|
56
|
+
"@auth0/component-cdn-uploader": "^2.4.0",
|
|
57
57
|
"@rollup/plugin-replace": "^4.0.0",
|
|
58
58
|
"@types/cypress": "^1.1.3",
|
|
59
59
|
"@types/jest": "^28.1.7",
|
package/src/Auth0Client.ts
CHANGED
|
@@ -1547,10 +1547,13 @@ export class Auth0Client {
|
|
|
1547
1547
|
/**
|
|
1548
1548
|
* Initiates a redirect to connect the user's account with a specified connection.
|
|
1549
1549
|
* This method generates PKCE parameters, creates a transaction, and redirects to the /connect endpoint.
|
|
1550
|
+
*
|
|
1551
|
+
* You must enable `Offline Access` from the Connection Permissions settings to be able to use the connection with Connected Accounts.
|
|
1550
1552
|
*
|
|
1551
1553
|
* @template TAppState - The application state to persist through the transaction.
|
|
1552
1554
|
* @param {RedirectConnectAccountOptions<TAppState>} options - Options for the connect account redirect flow.
|
|
1553
1555
|
* @param {string} options.connection - The name of the connection to link (e.g. 'google-oauth2').
|
|
1556
|
+
* @param {string[]} [options.scopes] - Array of scopes to request from the Identity Provider during the connect account flow.
|
|
1554
1557
|
* @param {AuthorizationParams} [options.authorization_params] - Additional authorization parameters for the request to the upstream IdP.
|
|
1555
1558
|
* @param {string} [options.redirectUri] - The URI to redirect back to after connecting the account.
|
|
1556
1559
|
* @param {TAppState} [options.appState] - Application state to persist through the transaction.
|
|
@@ -1566,6 +1569,7 @@ export class Auth0Client {
|
|
|
1566
1569
|
openUrl,
|
|
1567
1570
|
appState,
|
|
1568
1571
|
connection,
|
|
1572
|
+
scopes,
|
|
1569
1573
|
authorization_params,
|
|
1570
1574
|
redirectUri = this.options.authorizationParams.redirect_uri ||
|
|
1571
1575
|
window.location.origin
|
|
@@ -1583,6 +1587,7 @@ export class Auth0Client {
|
|
|
1583
1587
|
const { connect_uri, connect_params, auth_session } =
|
|
1584
1588
|
await this.myAccountApi.connectAccount({
|
|
1585
1589
|
connection,
|
|
1590
|
+
scopes,
|
|
1586
1591
|
redirect_uri: redirectUri,
|
|
1587
1592
|
state,
|
|
1588
1593
|
code_challenge,
|
|
@@ -4,12 +4,12 @@ import { Fetcher } from './fetcher';
|
|
|
4
4
|
interface ConnectRequest {
|
|
5
5
|
/** The name of the connection to link the account with (e.g., 'google-oauth2', 'facebook'). */
|
|
6
6
|
connection: string;
|
|
7
|
+
/** Array of scopes to request from the Identity Provider during the connect account flow. */
|
|
8
|
+
scopes?: string[];
|
|
7
9
|
/** The URI to redirect to after the connection process completes. */
|
|
8
10
|
redirect_uri: string;
|
|
9
11
|
/** An opaque value used to maintain state between the request and callback. */
|
|
10
12
|
state?: string;
|
|
11
|
-
/** A string value used to associate a Client session with an ID Token, and to mitigate replay attacks. */
|
|
12
|
-
nonce?: string;
|
|
13
13
|
/** The PKCE code challenge derived from the code verifier. */
|
|
14
14
|
code_challenge?: string;
|
|
15
15
|
/** The method used to derive the code challenge. Required when code_challenge is provided. */
|
package/src/global.ts
CHANGED
|
@@ -556,22 +556,23 @@ export interface RedirectConnectAccountOptions<TAppState = any> {
|
|
|
556
556
|
connection: string;
|
|
557
557
|
|
|
558
558
|
/**
|
|
559
|
-
*
|
|
560
|
-
*
|
|
559
|
+
* Array of scopes to request from the Identity Provider during the connect account flow.
|
|
560
|
+
*
|
|
561
561
|
* @example
|
|
562
562
|
* await auth0.connectAccountWithRedirect({
|
|
563
563
|
* connection: 'google-oauth2',
|
|
564
|
-
*
|
|
565
|
-
* scope: 'https://www.googleapis.com/auth/calendar'
|
|
566
|
-
* access_type: 'offline'
|
|
567
|
-
* }
|
|
564
|
+
* scopes: ['https://www.googleapis.com/auth/calendar']
|
|
568
565
|
* });
|
|
566
|
+
*/
|
|
567
|
+
scopes?: string[];
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Additional authorization parameters for the request.
|
|
569
571
|
*
|
|
570
572
|
* @example
|
|
571
573
|
* await auth0.connectAccountWithRedirect({
|
|
572
574
|
* connection: 'github',
|
|
573
575
|
* authorization_params: {
|
|
574
|
-
* scope: 'repo user',
|
|
575
576
|
* audience: 'https://api.github.com'
|
|
576
577
|
* }
|
|
577
578
|
* });
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.
|
|
1
|
+
export default '2.9.0';
|