Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions messages/org.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ The sandbox %s cannot resume with status of %s.

Failed to generate a frontdoor URL.

# FrontdoorURLBadOauthToken

Failed to generate a frontdoor URL.

# FrontdoorURLBadOauthToken.actions

- Check that the user "%s" does not have the "API Only User" permission assigned, it prevents browser access.

# FlowIdNotFound

ID not found for Flow %s.
Expand Down
1 change: 1 addition & 0 deletions schemas/project-scratch-def.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@
"EinsteinGPTForDevelopers",
"EinsteinRecommendationBuilder",
"EinsteinRecommendationBuilderMetadata",
"EinsteinSalesRepFdbk",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some git hook/npm script added this

"EinsteinSearch",
"EinsteinVisits",
"EinsteinVisitsED",
Expand Down
14 changes: 11 additions & 3 deletions src/org/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,17 @@ export class Org extends AsyncOptionalCreatable<Org.Options> {
singleAccessUrl.searchParams.append('redirect_uri', redirectUri);
}

const response = await this.connection.requestGet<SingleAccessUrlRes>(singleAccessUrl.toString());
if (response.frontdoor_uri) return response.frontdoor_uri;
throw new SfError(messages.getMessage('FrontdoorURLError')).setData(response);
try {
const response = await this.connection.requestGet<SingleAccessUrlRes>(singleAccessUrl.toString());
if (response.frontdoor_uri) return response.frontdoor_uri;
throw new SfError(messages.getMessage('FrontdoorURLError')).setData(response);
} catch (err) {
// See: https://help.salesforce.com/s/articleView?id=xcloud.frontdoor_singleaccess.htm&type=5
if (err instanceof Error && err.message.includes('Bad_OAuth_Token')) {
throw messages.createError('FrontdoorURLBadOauthToken', undefined, [this.getUsername()]);
}
throw err;
}
}

/**
Expand Down
Loading