Skip to content

Commit 5a26386

Browse files
committed
Added base URL so it doesn't confuse others down the road
1 parent c1e39b6 commit 5a26386

7 files changed

+17
-8
lines changed

angular.json

+3
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,8 @@
9191
}
9292
}
9393
}
94+
},
95+
"cli": {
96+
"analytics": "ba59284d-5e0e-42e0-a9ba-503c763a3889"
9497
}
9598
}

package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
"karma-jasmine-html-reporter": "~2.1.0",
3838
"postcss-loader": "^7.3.3",
3939
"tailwindcss": "^3.3.3",
40-
"typescript": "~5.2.0"
40+
"typescript": "<5.2.0"
4141
}
4242
}

src/app/auth.service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class AuthService {
1919
constructor() {
2020
this.sdk = Descope({
2121
projectId: environment.descopeProjectId,
22+
baseUrl: environment.baseURL,
2223
persistTokens: true,
2324
autoRefresh: true,
2425
});

src/app/login/login.component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { environment } from '../../environments/environment';
99
})
1010
export class LoginComponent implements OnInit {
1111
descopeProjectId!: string;
12+
descopeBaseURL!: string;
1213

1314
constructor(
1415
private elRef: ElementRef,
@@ -18,15 +19,18 @@ export class LoginComponent implements OnInit {
1819

1920
ngOnInit(): void {
2021
this.descopeProjectId = environment.descopeProjectId;
22+
this.descopeBaseURL = environment.baseURL;
2123
this.initDescopeWc();
2224
}
2325

2426
private initDescopeWc(): void {
2527
const wcElement = this.renderer.createElement('descope-wc');
2628

2729
this.renderer.setAttribute(wcElement, 'project-id', this.descopeProjectId);
30+
this.renderer.setAttribute(wcElement, 'base-url', this.descopeBaseURL);
2831
this.renderer.setAttribute(wcElement, 'flow-id', 'sign-up-or-in');
2932
this.renderer.setAttribute(wcElement, 'theme', 'light');
33+
this.renderer.setAttribute(wcElement, 'persistTokens', 'true');
3034

3135
const parentElement = this.elRef.nativeElement;
3236
this.renderer.appendChild(parentElement, wcElement);
+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const environment = {
22
production: false,
33
descopeProjectId: '<Descope Project ID>',
4+
baseURL: "https://api.descope.com"
45
};

src/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<base href="/" />
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
88
<link rel="icon" type="image/x-icon" href="favicon.ico" />
9-
<script src="https://unpkg.com/@descope/web-component@2.8.12/dist/index.js"></script>
10-
<script src="https://unpkg.com/@descope/web-js-sdk@1.4.3/dist/index.umd.js"></script>
9+
<script src="https://unpkg.com/@descope/web-component@2.11.3/dist/index.js"></script>
10+
<script src="https://unpkg.com/@descope/web-js-sdk@1.6.2/dist/index.umd.js"></script>
1111
<link
1212
rel="stylesheet"
1313
href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"

0 commit comments

Comments
 (0)