@myxtra/authentication-green 2.1.0 → 2.3.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 +41 -17
- package/dist/{App-b8d0f682.mjs → App-c57e7c72.mjs} +754 -748
- package/dist/icons/bouMenuIcons.html +74 -0
- package/dist/{index-c468a93b.mjs → index-97a2898d.mjs} +3550 -3544
- package/dist/xtra-authentication.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -51,10 +51,10 @@ the access token if it is present.
|
|
|
51
51
|
|
|
52
52
|
Examples of some endpoints that will be called by components:
|
|
53
53
|
|
|
54
|
-
| BFF URL
|
|
55
|
-
|
|
|
56
|
-
| https://bff.syst.mijnxtra.be/xtra/newsletter/v1/newsletters | https://api.syst.myxtra.be/newsletter/v1/newsletters |
|
|
57
|
-
| https://bff.syst.mijnxtra.be/xtra/newsletter/v1/newsletters?partnerClientId=123456 | https://api.syst.myxtra.be/newsletter/v1/newsletters?partnerClientId=123456 |
|
|
54
|
+
| BFF URL | API Gateway URL |
|
|
55
|
+
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
|
|
56
|
+
| <https://bff.syst.mijnxtra.be/xtra/newsletter/v1/newsletters> | <https://api.syst.myxtra.be/newsletter/v1/newsletters> |
|
|
57
|
+
| <https://bff.syst.mijnxtra.be/xtra/newsletter/v1/newsletters?partnerClientId=123456> | <https://api.syst.myxtra.be/newsletter/v1/newsletters?partnerClientId=123456> |
|
|
58
58
|
|
|
59
59
|
## Installation
|
|
60
60
|
|
|
@@ -75,7 +75,7 @@ package in two ways.
|
|
|
75
75
|
</head>
|
|
76
76
|
<body>
|
|
77
77
|
<header>
|
|
78
|
-
<xtra-authentication></xtra-authentication>
|
|
78
|
+
<xtra-authentication flyoutPlacement="bottom-end"></xtra-authentication>
|
|
79
79
|
</header>
|
|
80
80
|
</body>
|
|
81
81
|
</html>
|
|
@@ -114,8 +114,6 @@ type Config = {
|
|
|
114
114
|
environment: 'dev' | 'test' | 'syst' | 'prod';
|
|
115
115
|
// The redirect url the BFF should redirect to after the user has logged in. Defaults to window.location.href
|
|
116
116
|
redirectUrl?: string;
|
|
117
|
-
// The position of the flyout menu, defaults to 'right'
|
|
118
|
-
position?: 'left' | 'right';
|
|
119
117
|
// The ID of the commerce/BOU for which the component will show the icon when the Terms & Condition dialog is shown.
|
|
120
118
|
commerceId?:
|
|
121
119
|
| 'bioplanet'
|
|
@@ -130,9 +128,34 @@ type Config = {
|
|
|
130
128
|
| 'okay'
|
|
131
129
|
| 'spar'
|
|
132
130
|
| 'xtra';
|
|
131
|
+
// Add links to custom pages on the menu (only visible to authenticated users)
|
|
132
|
+
bouMenuItems?: Array<{
|
|
133
|
+
label: string; // Text to display for the link
|
|
134
|
+
url: string; // URL of the custom page
|
|
135
|
+
icon: string; // Icon to show in front of the text (see disclaimer below)
|
|
136
|
+
}>;
|
|
133
137
|
};
|
|
134
138
|
```
|
|
135
139
|
|
|
140
|
+
> ❗ You can find a list of available BOU menu item icons
|
|
141
|
+
> [here](https://unpkg.com/@myxtra/authentication-green/dist/icons/bouMenuIcons.html).
|
|
142
|
+
|
|
143
|
+
## Position
|
|
144
|
+
|
|
145
|
+
To change the direction in which the menu of the authentication component will open, you can pass a
|
|
146
|
+
flyoutPlacement value to the component.
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
<xtra-authentication flyoutPlacement="bottom-start></xtra-authentication>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Possible values are:
|
|
153
|
+
|
|
154
|
+
- top-start
|
|
155
|
+
- top-end
|
|
156
|
+
- bottom-start
|
|
157
|
+
- bottom-end (default)
|
|
158
|
+
|
|
136
159
|
## Events & window object
|
|
137
160
|
|
|
138
161
|
The authentication component will emit events and add properties to the window object. For backwards
|
|
@@ -153,16 +176,17 @@ type XTRA = {
|
|
|
153
176
|
yob: () => number;
|
|
154
177
|
gender: () => 'M' | 'F';
|
|
155
178
|
phone: () => string;
|
|
156
|
-
streetName: () => string
|
|
157
|
-
houseNr: () => string
|
|
158
|
-
box: () => string
|
|
159
|
-
zip: () => string
|
|
160
|
-
city: () => string
|
|
161
|
-
country: () => string
|
|
162
|
-
email: () => string
|
|
163
|
-
cbh: () => string
|
|
164
|
-
state: () => 'Authenticated'
|
|
165
|
-
}
|
|
179
|
+
streetName: () => string;
|
|
180
|
+
houseNr: () => string;
|
|
181
|
+
box: () => string;
|
|
182
|
+
zip: () => string;
|
|
183
|
+
city: () => string;
|
|
184
|
+
country: () => string;
|
|
185
|
+
email: () => string;
|
|
186
|
+
cbh: () => string;
|
|
187
|
+
state: () => 'Authenticated';
|
|
188
|
+
};
|
|
189
|
+
};
|
|
166
190
|
```
|
|
167
191
|
|
|
168
192
|
The authenticated event is sent through
|