Skip to content

Commit 3fe95d2

Browse files
committed
Added custom endpoint to service provider.
1 parent 3e36046 commit 3fe95d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CognitoUserPool.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class CognitoUserPool {
3030
* @param {object} data.Storage Optional storage object.
3131
*/
3232
constructor(data) {
33-
const { UserPoolId, ClientId } = data || {};
33+
const { UserPoolId, ClientId, endpoint } = data || {};
3434
if (!UserPoolId || !ClientId) {
3535
throw new Error('Both UserPoolId and ClientId are required.');
3636
}
@@ -42,7 +42,7 @@ export default class CognitoUserPool {
4242
this.userPoolId = UserPoolId;
4343
this.clientId = ClientId;
4444

45-
this.client = new CognitoIdentityServiceProvider({ apiVersion: '2016-04-19', region });
45+
this.client = new CognitoIdentityServiceProvider({ apiVersion: '2016-04-19', region, endpoint });
4646

4747
this.storage = data.Storage || new StorageHelper().getStorage();
4848
}

0 commit comments

Comments
 (0)