Skip to content

Commit 43a597b

Browse files
Adding support for custom authorize Endpoints (#92)
* Adding support for custom Authorize Endpoints * Passing custom revokeEndpoint, userInfoEndpoint * Bump new version 3.0.2 * Bump new version 3.0.2
1 parent c959ed5 commit 43a597b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intuit-oauth",
3-
"version": "3.0.1",
3+
"version": "3.0.2",
44
"description": "Intuit Node.js client for OAuth2.0 and OpenIDConnect",
55
"main": "./src/OAuthClient.js",
66
"scripts": {

src/OAuthClient.js

+15
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ OAuthClient.user_agent = `Intuit-OAuthClient-JS_${
108108
version.version
109109
}_${os.type()}_${os.release()}_${os.platform()}`;
110110

111+
OAuthClient.prototype.setAuthorizeURLs = function setAuthorizeURLs(params) {
112+
// check if the customURL's are passed correctly
113+
if (!params) {
114+
throw new Error("Provide the custom authorize URL's");
115+
}
116+
OAuthClient.authorizeEndpoint = params.authorizeEndpoint;
117+
OAuthClient.tokenEndpoint = params.tokenEndpoint;
118+
OAuthClient.revokeEndpoint = params.revokeEndpoint;
119+
this.environment === 'sandbox'
120+
? (OAuthClient.userinfo_endpoint_sandbox = params.userInfoEndpoint)
121+
: (OAuthClient.userinfo_endpoint_production = params.userInfoEndpoint);
122+
123+
return this;
124+
};
125+
111126
/**
112127
* Redirect User to Authorization Page
113128
* *

0 commit comments

Comments
 (0)