@myxtra/authentication-green 2.15.0 → 2.17.0

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/README.md CHANGED
@@ -108,13 +108,17 @@ The authentication package has the following configuration properties which are
108
108
 
109
109
  ```ts
110
110
  type Config = {
111
- // The URL of the BFF the authentication component will redirect and do fetch requests to
112
- apiUrl: string;
113
111
  // The environment on which the authentication component is running on
114
112
  environment: 'dev' | 'test' | 'syst' | 'prod';
113
+ // The URL of the BFF the authentication component will do fetch requests to
114
+ apiUrl: string;
115
+ // The URL of the BFF the authentication component will perform login, logout and redirect calls to
116
+ // ! Only necessary when different then apiUrl, because it defaults to the provided apiUrl.
117
+ authUrl?: string;
115
118
  // The redirect url the BFF should redirect to after the user has logged in. Defaults to window.location.href
116
119
  redirectUrl?: string;
117
120
  // The ID of the commerce/BOU for which the component will show the icon when the Terms & Condition dialog is shown.
121
+ // Defaults to 'xtra'
118
122
  commerceId?:
119
123
  | 'bioplanet'
120
124
  | 'collectgo'
@@ -134,6 +138,7 @@ type Config = {
134
138
  url: string; // URL of the custom page
135
139
  icon: string; // Icon to show in front of the text (see disclaimer below)
136
140
  }>;
141
+ country?: 'BE' | 'FR'; // Show options from specific country. Defaults to 'BE'
137
142
  };
138
143
  ```
139
144
 
@@ -212,11 +217,11 @@ const onMessage = (message: MessageEvent<XtraAuthenticationMessageEventData>) =>
212
217
  }
213
218
 
214
219
  if (!event.data.isAuthenticated) {
215
- // TODO: add logic in case the user is not authenticated
220
+ // TO DO: add logic in case the user is not authenticated
216
221
  return;
217
222
  }
218
223
 
219
- // TODO: add logic when the user is authenticated (window.xtra is set here)
224
+ // TO DO: add logic when the user is authenticated (window.xtra is set here)
220
225
  };
221
226
 
222
227
  window.addEventListener('message', onMessage);