File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ const messages = Messages.loadMessages('@salesforce/core', 'auth');
2828// Server ignores requests for site icons
2929const iconPaths = [ '/favicon.ico' , '/apple-touch-icon-precomposed.png' ] ;
3030
31- const CODE_BUILDER_REDIRECT_URI = 'api/oauth2/salesforce/callback' ;
31+ const CODE_BUILDER_REDIRECT_URI_STAGE =
32+ 'https://api.code-builder-stg.platform.salesforce.com/api/oauth/salesforce/callback' ;
33+ const CODE_BUILDER_REDIRECT_URI_PROD = 'https://api.code-builder.platform.salesforce.com/api/oauth/salesforce/callback' ;
3234
3335/**
3436 * Handles the creation of a web server for web based login flows.
@@ -216,8 +218,8 @@ export class WebOAuthServer extends AsyncCreatable<WebOAuthServer.Options> {
216218 CODE_BUILDER_URI : cbUri ,
217219 CODE_BUILDER_STATE_SHA : cbStateSha ,
218220 } ) ;
219- const maybeSlash = this . oauthConfig . loginUrl . endsWith ( '/' ) ? '' : '/' ;
220- this . oauthConfig . redirectUri = ` ${ this . oauthConfig . loginUrl } ${ maybeSlash } ${ CODE_BUILDER_REDIRECT_URI } ` ;
221+ const cbProd = env . getBoolean ( 'CODE_BUILDER_PROD' ) ;
222+ this . oauthConfig . redirectUri = cbProd ? CODE_BUILDER_REDIRECT_URI_PROD : CODE_BUILDER_REDIRECT_URI_STAGE ;
221223 } else {
222224 this . oauthConfig . clientId ??= DEFAULT_CONNECTED_APP_INFO . clientId ;
223225 this . oauthConfig . redirectUri ??= `http://localhost:${ port } /OauthRedirect` ;
You can’t perform that action at this time.
0 commit comments