Skip to content

Commit 0711aab

Browse files
imayblumgaokevin1
andauthored
Regional (#228)
* eu regional support * fix api domain * Update src/components/loginExperiences/API/Api.js Co-authored-by: Kevin J Gao <32936811+gaokevin1@users.noreply.github.com> --------- Co-authored-by: Kevin J Gao <32936811+gaokevin1@users.noreply.github.com>
1 parent 78c919d commit 0711aab

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

cypress/support/commands.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const projectId = Cypress.env('descope_project_id')
22
const managementKey = Cypress.env('descope_management_key')
3-
const descopeAPIDomain = "api.descope.com"
3+
let descopeAPIDomain = "api.descope.com"
4+
if (projectId.length >= 32) {
5+
const localURL = projectId.substring(1, 5)
6+
descopeAPIDomain = [descopeAPIDomain.slice(0, 4), localURL, ".", descopeAPIDomain.slice(4)].join('')
7+
}
48

59
// Define the authorization header
610
const authHeader = {

src/components/loginExperiences/API/Api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const API = () => {
1111
}, []);
1212

1313
const code = `// Rest API call for signup or signin user
14+
// Replace api.descope.com with localized base URL, if located outside the US or using CNAME and custom domain
1415
1516
curl -i -X POST
1617
https://api.descope.com/v1/auth/otp/signup-in/email

0 commit comments

Comments
 (0)