@eml-payments/core-sdk 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core-sdk.d.ts +1 -1
- package/dist/core-sdk.js +11 -2
- package/package.json +1 -1
package/dist/core-sdk.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class CoreSDK {
|
|
|
17
17
|
* Redirect to login endpoint
|
|
18
18
|
* The BFF will handle the OAuth flow
|
|
19
19
|
*/
|
|
20
|
-
login(): void;
|
|
20
|
+
login(email?: string): void;
|
|
21
21
|
/**
|
|
22
22
|
* Logout the current user
|
|
23
23
|
* Calls the BFF logout endpoint and optionally redirects to Azure AD logout
|
package/dist/core-sdk.js
CHANGED
|
@@ -27,8 +27,17 @@ export class CoreSDK {
|
|
|
27
27
|
* Redirect to login endpoint
|
|
28
28
|
* The BFF will handle the OAuth flow
|
|
29
29
|
*/
|
|
30
|
-
login() {
|
|
31
|
-
|
|
30
|
+
login(email) {
|
|
31
|
+
if (email) {
|
|
32
|
+
// Start For development/testing, we can pass an email to pre-fill the login form
|
|
33
|
+
console.log(`Redirecting to login with email: ${email}`);
|
|
34
|
+
console.log(`Login URL: ${this.baseUrl}/api/auth/login?email=${encodeURIComponent(email)}`);
|
|
35
|
+
// End
|
|
36
|
+
globalThis.location.href = `${this.baseUrl}/api/auth/login?email=${encodeURIComponent(email)}`;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
globalThis.location.href = `${this.baseUrl}/api/auth/login`;
|
|
40
|
+
}
|
|
32
41
|
}
|
|
33
42
|
/**
|
|
34
43
|
* Logout the current user
|