@schibsted/account-sdk-browser 4.7.2 → 4.7.5
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 +55 -204
- package/es5/global.js +15 -2
- package/es5/global.js.map +1 -1
- package/es5/global.min.js +1 -1
- package/es5/global.min.js.map +1 -1
- package/es5/identity.js +15 -2
- package/es5/identity.js.map +1 -1
- package/es5/identity.min.js +1 -1
- package/es5/identity.min.js.map +1 -1
- package/es5/index.js +15 -2
- package/es5/index.js.map +1 -1
- package/es5/index.min.js +1 -1
- package/es5/index.min.js.map +1 -1
- package/es5/monetization.js +15 -2
- package/es5/monetization.js.map +1 -1
- package/es5/monetization.min.js +1 -1
- package/es5/monetization.min.js.map +1 -1
- package/package.json +4 -2
- package/src/cache.js +14 -1
- package/src/identity.d.ts +4 -2
- package/CHANGELOG.md +0 -538
- package/NOTICE +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schibsted/account-sdk-browser",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.5",
|
|
4
4
|
"description": "Schibsted account SDK for browsers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"test": "jest",
|
|
13
13
|
"precover": "npm run lint",
|
|
14
14
|
"cover": "jest --coverage",
|
|
15
|
-
"postcover": "codecov"
|
|
15
|
+
"postcover": "codecov",
|
|
16
|
+
"preversion": "npm test",
|
|
17
|
+
"postversion": "git push && git push --tags"
|
|
16
18
|
},
|
|
17
19
|
"author": "",
|
|
18
20
|
"license": "MIT",
|
package/src/cache.js
CHANGED
|
@@ -93,9 +93,22 @@ export default class Cache {
|
|
|
93
93
|
* @returns {*} - The value if it exists, otherwise null
|
|
94
94
|
*/
|
|
95
95
|
get(key) {
|
|
96
|
+
/**
|
|
97
|
+
* JSON.parse safe wrapper
|
|
98
|
+
* @param {string} raw
|
|
99
|
+
* @returns {*} parsed value or null if failed to parse
|
|
100
|
+
*/
|
|
101
|
+
function getObj(raw) {
|
|
102
|
+
try {
|
|
103
|
+
return JSON.parse(raw);
|
|
104
|
+
} catch (e) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
96
109
|
try {
|
|
97
110
|
const raw = this.cache.get(key);
|
|
98
|
-
|
|
111
|
+
let obj = getObj(raw);
|
|
99
112
|
if (obj && Number.isInteger(obj.expiresOn) && obj.expiresOn > Date.now()) {
|
|
100
113
|
return obj.value;
|
|
101
114
|
}
|
package/src/identity.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { TinyEmitter } from 'tiny-emitter';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
* Provides Identity
|
|
4
|
+
* Provides Identity functionality to a web page
|
|
3
5
|
*/
|
|
4
|
-
export class Identity {
|
|
6
|
+
export class Identity extends TinyEmitter {
|
|
5
7
|
/**
|
|
6
8
|
* @param {object} options
|
|
7
9
|
* @param {string} options.clientId - Example: "1234567890abcdef12345678"
|
package/CHANGELOG.md
DELETED
|
@@ -1,538 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 4.7.2 (2023-01-31)
|
|
4
|
-
* Update path to Schibsted account profile pages.
|
|
5
|
-
|
|
6
|
-
## v4.7.1 (2023-01-24)
|
|
7
|
-
* Add support for eID Finland
|
|
8
|
-
|
|
9
|
-
## v4.7.0 (2022-10-27)
|
|
10
|
-
* Add locale support in the Simplified Login widget
|
|
11
|
-
|
|
12
|
-
## v4.6.0 (2022-02-23)
|
|
13
|
-
|
|
14
|
-
## New features
|
|
15
|
-
* Add `eid`, `eid-no` and `eid-se` to valid acrValues
|
|
16
|
-
|
|
17
|
-
## v4.5.3 (2021-11-26)
|
|
18
|
-
|
|
19
|
-
## Fixes
|
|
20
|
-
* Fix SimplifiedLoginWidgetLoginOptions typo
|
|
21
|
-
|
|
22
|
-
## v4.5.2 (2021-11-26)
|
|
23
|
-
|
|
24
|
-
## Fixes
|
|
25
|
-
* Fix SimplifiedLoginWidgetLoginOptions
|
|
26
|
-
|
|
27
|
-
## v4.5.1 (2021-11-19)
|
|
28
|
-
|
|
29
|
-
## Fixes
|
|
30
|
-
* .d.ts files publishing
|
|
31
|
-
|
|
32
|
-
## v4.5.0 (2021-09-29)
|
|
33
|
-
|
|
34
|
-
## New features
|
|
35
|
-
* Add Danish env
|
|
36
|
-
|
|
37
|
-
## Fixes
|
|
38
|
-
* `options` param in `showSimplifiedLoginWidget` function is optional in Typescript now
|
|
39
|
-
|
|
40
|
-
## v4.4.0 (2021-06-24)
|
|
41
|
-
|
|
42
|
-
## New features
|
|
43
|
-
* Added optional `options` param to `showSimplifiedLoginWidget` function, allowing to specify widget `encoding`
|
|
44
|
-
|
|
45
|
-
## v4.3.0 (2020-12-16)
|
|
46
|
-
|
|
47
|
-
## New features
|
|
48
|
-
* Add `not you?` button to simplified login widget
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## v4.2.1 (2020-18-11)
|
|
52
|
-
|
|
53
|
-
## Fixes
|
|
54
|
-
* Fix TS issues
|
|
55
|
-
|
|
56
|
-
## v4.2.0 (2020-11-09)
|
|
57
|
-
|
|
58
|
-
## New features
|
|
59
|
-
* Add Finnish env
|
|
60
|
-
|
|
61
|
-
## v4.1.0 (2020-11-03)
|
|
62
|
-
|
|
63
|
-
## New features
|
|
64
|
-
* Add .d.ts files
|
|
65
|
-
|
|
66
|
-
## v4.0.0 (2020-09-03)
|
|
67
|
-
|
|
68
|
-
## Breaking changes
|
|
69
|
-
* `sessionDomain` is required
|
|
70
|
-
* Removed `siteSpecificLogout` param- there is no option to disable site specific logout
|
|
71
|
-
* `hasSession` does not accept `autologin` param anymore
|
|
72
|
-
* Drop `hasProduct` and `hasSubscription` functions- replaced by `hasAccess`
|
|
73
|
-
|
|
74
|
-
## New features
|
|
75
|
-
* Add 2FA Support- new `acrValues`: `sms`, `otp`, `password`
|
|
76
|
-
* `logSettings` function
|
|
77
|
-
|
|
78
|
-
## Changes
|
|
79
|
-
* babel has been updated to `^7.11`
|
|
80
|
-
|
|
81
|
-
## v3.4.0 (2020-04-28)
|
|
82
|
-
|
|
83
|
-
## Changes
|
|
84
|
-
* showSimplifiedLoginWidget accepts async function as state param - will be called only if user click log in
|
|
85
|
-
* Support for pulse providerId in simplified login widget
|
|
86
|
-
|
|
87
|
-
## New features
|
|
88
|
-
* Added `clearCachedAccessResult` and `clearCachedUserSession` methods
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
## v3.3.0 (2020-04-07)
|
|
92
|
-
|
|
93
|
-
## New features
|
|
94
|
-
* hasAccess - function that check if you have access to productsIds
|
|
95
|
-
|
|
96
|
-
## v3.2.0 (2020-03-19)
|
|
97
|
-
|
|
98
|
-
## Fixes
|
|
99
|
-
* Cache 400 http responses from session service
|
|
100
|
-
|
|
101
|
-
## New features
|
|
102
|
-
* showSimplifiedLoginWidget - function that loads and displays simplified login widget
|
|
103
|
-
|
|
104
|
-
## v3.1.1 (2020-02-20)
|
|
105
|
-
|
|
106
|
-
## Changes
|
|
107
|
-
* Use sessionStorage as identity cache instead of localStorage
|
|
108
|
-
|
|
109
|
-
## v3.1.0 (2020-02-06)
|
|
110
|
-
|
|
111
|
-
## Changes
|
|
112
|
-
* Enable siteSpecificLogout by default
|
|
113
|
-
|
|
114
|
-
## v3.0.7 (2019-11-12)
|
|
115
|
-
|
|
116
|
-
### Fixes
|
|
117
|
-
* Refactor hasSession to fix ie11 bug
|
|
118
|
-
|
|
119
|
-
## v3.1.0-rc (2019-10-02)
|
|
120
|
-
|
|
121
|
-
### Semi-breaking ish changes
|
|
122
|
-
* Enable site specific logout by default- it is experimental feature for now
|
|
123
|
-
|
|
124
|
-
### Fixes
|
|
125
|
-
* Update PublicUserData type description
|
|
126
|
-
|
|
127
|
-
## v3.0.6 (2019-09-18)
|
|
128
|
-
|
|
129
|
-
### New features
|
|
130
|
-
* New method getUserContextData
|
|
131
|
-
* siteSpecificLogout flag (default false). When enabled, logout will logout user from local session-service, but not from Schibsted Account
|
|
132
|
-
|
|
133
|
-
## v3.0.5 (2019-05-23)
|
|
134
|
-
|
|
135
|
-
### Fixes
|
|
136
|
-
|
|
137
|
-
* Do not display ITP dialog when session service is enabled
|
|
138
|
-
* Mark purchasePaylinkUrl as depracated
|
|
139
|
-
|
|
140
|
-
## v3.0.4 (2019-03-14)
|
|
141
|
-
|
|
142
|
-
### Fixes
|
|
143
|
-
|
|
144
|
-
* Use `reject` in hasSession `promiseFn`
|
|
145
|
-
|
|
146
|
-
## v3.0.3 (2019-01-28)
|
|
147
|
-
|
|
148
|
-
## Changes
|
|
149
|
-
|
|
150
|
-
* Add `oneStepLogin` option to `login` function. If set to `true` username and password will be display on one page
|
|
151
|
-
* Introduce `purchasePromoCodeProductFlowUrl`- function returns url for zuora subscription flow
|
|
152
|
-
|
|
153
|
-
## v3.0.2 (2018-12-11)
|
|
154
|
-
|
|
155
|
-
## Changes
|
|
156
|
-
|
|
157
|
-
* Add possibility to set SP_ID cookie domain with enableVarnishCookie function param
|
|
158
|
-
|
|
159
|
-
## v3.0.1 (2018-11-06)
|
|
160
|
-
|
|
161
|
-
## Fixes
|
|
162
|
-
|
|
163
|
-
* Fix LOCAL SDRN namespace
|
|
164
|
-
* Silent error on Object.assign in SDKError for ios 9
|
|
165
|
-
* Update jest
|
|
166
|
-
|
|
167
|
-
## v3.0.0 (2018-10-15)
|
|
168
|
-
|
|
169
|
-
## Fixes
|
|
170
|
-
|
|
171
|
-
* Fix LOCAL SDRN namespace
|
|
172
|
-
|
|
173
|
-
## v3.0.0 (2018-10-15)
|
|
174
|
-
|
|
175
|
-
## Removed rc
|
|
176
|
-
|
|
177
|
-
## Fixes
|
|
178
|
-
|
|
179
|
-
* fix typeof in clearVarnishCookie
|
|
180
|
-
|
|
181
|
-
## v3.0.0-rc.21 (2018-10-10)
|
|
182
|
-
|
|
183
|
-
## Semi-breaking ish changes
|
|
184
|
-
|
|
185
|
-
* Monetization functions `hasProduct` and `hasSubscription` didn't list `@throws` in the docs, even
|
|
186
|
-
though there was always a chance of those functions throwing SDKError if anything went wrong
|
|
187
|
-
during a network call. Also, the `spId` parameter is back to being a required parameter, since
|
|
188
|
-
it's used when caching results (and without it, cache data could in theory span different users)
|
|
189
|
-
|
|
190
|
-
## Fixes
|
|
191
|
-
|
|
192
|
-
* Monetization functions `hasProduct` and `hasSubscription` now fall back to calling the Schibsted
|
|
193
|
-
account backend if a call to the session-service fails with a 400 error (meaning a session-cookie
|
|
194
|
-
is not present).
|
|
195
|
-
|
|
196
|
-
## Changes
|
|
197
|
-
|
|
198
|
-
* Monetization functions `hasProducts` and `hasSubscription` now caches both failures (for 10
|
|
199
|
-
seconds) and successes (for 1 hour)
|
|
200
|
-
|
|
201
|
-
## v3.0.0-rc.20 (2018-10-09)
|
|
202
|
-
|
|
203
|
-
### Fixes
|
|
204
|
-
|
|
205
|
-
* Setting a Varnish cookie (the `SP_ID` cookie) will now be done with a top-level domain as the
|
|
206
|
-
domain value. So if done from some.sub.site.example, we will use `domain=site.example`. Thanks to
|
|
207
|
-
@olekenneth for fixing it
|
|
208
|
-
|
|
209
|
-
## v3.0.0-rc.19 (2018-09-28)
|
|
210
|
-
|
|
211
|
-
### Breaking changes
|
|
212
|
-
|
|
213
|
-
* If you are using the session-service, calls to `Identity.hasSession` will not return the obsolete
|
|
214
|
-
`userStatus` or `id` fields (the numeric `userId` and the `uuid` fields are still returned).
|
|
215
|
-
* Calling `Identity.hasSession` multiple times will now cause only one network call. While this call
|
|
216
|
-
is running, other calls to `Identity.hasSession` will simply wait for that call to complete, and
|
|
217
|
-
then they will all resolve to the same result
|
|
218
|
-
|
|
219
|
-
### New features
|
|
220
|
-
|
|
221
|
-
* We can communicate with the session-service instead of Schibsted account in `Identity.hasSession`,
|
|
222
|
-
`Monetization.hasProduct` and `Monetization.hasSubscription` (quick howto; to opt into this, add a
|
|
223
|
-
param `sessionDomain: 'https://id.site.example'` to the constructor for Identity and Monetization)
|
|
224
|
-
|
|
225
|
-
## v3.0.0-rc.18 (2018-09-18 — second one today, yay 🎉)
|
|
226
|
-
|
|
227
|
-
### Breaking changes
|
|
228
|
-
|
|
229
|
-
* The `Identity.logout()` function is no longer an `async` function, and now does a full-page
|
|
230
|
-
redirect to the Schibsted account domain to log the user out. This is because we can't trust that
|
|
231
|
-
the XHR way of logging people out will work for Safari 12 users. Sorry for the breaking change,
|
|
232
|
-
but at least it works in a consistent way. It now also takes a parameter `redirectUri` that
|
|
233
|
-
defaults to the `redirectUri` from the `Identity` constructor. The browser will be redirected
|
|
234
|
-
there after Schibsted account has logged the user out
|
|
235
|
-
|
|
236
|
-
## v3.0.0-rc.17 (2018-09-18)
|
|
237
|
-
|
|
238
|
-
### Fixes
|
|
239
|
-
|
|
240
|
-
* Varnish cookie fixes: 1) The localstorage item was wrongly cleared when calling
|
|
241
|
-
`Identity.enableVarnishCookie()`, and 2) The varnish cookie was not removed correctly when calling
|
|
242
|
-
`Identity.logout()`.
|
|
243
|
-
|
|
244
|
-
## v3.0.0-rc.16 (2018-09-14)
|
|
245
|
-
|
|
246
|
-
### Fixes
|
|
247
|
-
|
|
248
|
-
* ITP: Set the z-index of the ITP dialog to a "zooper high value" to 🤞🏼 ensure 🤞🏼 that it hovers
|
|
249
|
-
above the main site content
|
|
250
|
-
|
|
251
|
-
## v3.0.0-rc.15 (2018-09-06)
|
|
252
|
-
|
|
253
|
-
### New features
|
|
254
|
-
|
|
255
|
-
* Support for new `Identity.login` parameters: `tag`, `teaser` and `maxAge`
|
|
256
|
-
* ITP: There are explicit methods in Identity for users that don't use the `login` method. See the
|
|
257
|
-
docs for
|
|
258
|
-
[showItpModalUponReturning](https://schibsted.github.io/account-sdk-browser/Identity.html#showItpModalUponReturning)
|
|
259
|
-
and
|
|
260
|
-
[suppressItpModal](https://schibsted.github.io/account-sdk-browser/Identity.html#suppressItpModal)
|
|
261
|
-
if you're interested
|
|
262
|
-
|
|
263
|
-
### Breaking changes (ish)
|
|
264
|
-
|
|
265
|
-
* The `Identity.loginUrl` method used to take a lot of arguments, and with this release it was about
|
|
266
|
-
to become even more (with the added `tag`, `teaser` and `maxAge` params mentioned above). This
|
|
267
|
-
release changes the signature to have a single `options` object instead of the argument list. In
|
|
268
|
-
this case we made it backwards-compatible, so it won't break (YET!) if you continue using an
|
|
269
|
-
argument list. Beware though, that passing a list of arguments is considered DEPRECATED as of now
|
|
270
|
-
* The es5 folder now contains both minified and unminified code. The minified ones have the
|
|
271
|
-
`.min.js` suffix. Before, only minified files were published, so if you're using those, you might
|
|
272
|
-
suddenly have bigger files than you did before. Sorry.. 🤷🏼
|
|
273
|
-
|
|
274
|
-
### Fixes
|
|
275
|
-
|
|
276
|
-
* [#76](https://github.com/schibsted/account-sdk-browser/issues/76) — Login on Chrome/iOS should now
|
|
277
|
-
work once again
|
|
278
|
-
|
|
279
|
-
## v3.0.0-rc.14 (2018-09-03)
|
|
280
|
-
|
|
281
|
-
### Changes
|
|
282
|
-
|
|
283
|
-
* The only change is adding a typings file to the `es5` folder. There are no functional changes from
|
|
284
|
-
rc.13
|
|
285
|
-
|
|
286
|
-
## v3.0.0-rc.13 (2018-08-31)
|
|
287
|
-
|
|
288
|
-
### Fixes
|
|
289
|
-
|
|
290
|
-
* The "Safari 12 ITP2 workaround" from v3.0.0-rc.11 had a bug where we passed the wrong query
|
|
291
|
-
parameter to the ITP dialog, so the dialog then failed to post a message back to the parent page.
|
|
292
|
-
In conclusion; calls to `Identity.hasSession` would still fail 😭.
|
|
293
|
-
|
|
294
|
-
## v3.0.0-rc.12 (2018-08-30)
|
|
295
|
-
|
|
296
|
-
This release is identical to rc.11 but includes index.d.ts in the npm package.
|
|
297
|
-
|
|
298
|
-
## v3.0.0-rc.11 (2018-08-30)
|
|
299
|
-
|
|
300
|
-
### New features
|
|
301
|
-
|
|
302
|
-
* Initial support for Safari 12. For users of this browser, there could be issues related to
|
|
303
|
-
Intelligent Tracking Prevention (ITP) v2. For the people who experience it, it would be impossible
|
|
304
|
-
to detect whether you're logged in or not from a given site (because cookies to Schibsted account
|
|
305
|
-
would be blocked because it's a third party). The Apple way to solve this, is to call
|
|
306
|
-
`requestStorageAccess` from an iframe, and let the user choose "Allow" in a scary Safari dialog.
|
|
307
|
-
Then cookies will once more be allowed to go to that third party. This SDK will now work around
|
|
308
|
-
this by showing a friendlier dialog before calling `requestStorageAccess` so people are hopefully
|
|
309
|
-
more inclined to click "Allow".
|
|
310
|
-
|
|
311
|
-
## v3.0.0-rc.10 (2018-08-10)
|
|
312
|
-
|
|
313
|
-
### Fixes
|
|
314
|
-
|
|
315
|
-
* [#68](https://github.com/schibsted/account-sdk-browser/issues/68) — Cache was not cleared after
|
|
316
|
-
calling `Identity.logout()` or `Identity.enableVarnishCache`
|
|
317
|
-
|
|
318
|
-
## v3.0.0-rc.9 (2018-08-08)
|
|
319
|
-
|
|
320
|
-
### Fixes
|
|
321
|
-
|
|
322
|
-
* Upgraded regenerator-runtime to fix [this CSP
|
|
323
|
-
issue](https://github.com/facebook/regenerator/issues/336) (courtesy of @henninga)
|
|
324
|
-
* [#64](https://github.com/schibsted/account-sdk-browser/issues/64) — This issue was fixed in two
|
|
325
|
-
ways. First, by changing the implementation so we set the Varnish cookie on every call to
|
|
326
|
-
`hasSession` (before we didn't do so when a `hasSession` returned cached data). Second, we
|
|
327
|
-
introduced an optional parameter `expiresIn` on the `Identity.enableVarnishCookie` where you can
|
|
328
|
-
override the default expiry of the Varnish cookie.
|
|
329
|
-
* [#54](https://github.com/schibsted/account-sdk-browser/issues/54) — Ensure that we clear the
|
|
330
|
-
Varnish cookie when a user logs out.
|
|
331
|
-
|
|
332
|
-
## v3.0.0-rc.8 (2018-07-17)
|
|
333
|
-
|
|
334
|
-
### Fixes
|
|
335
|
-
|
|
336
|
-
* Remove not logged in user cache on login call https://github.com/schibsted/account-sdk-browser/issues/62
|
|
337
|
-
|
|
338
|
-
## v3.0.0-rc.7 (2018-07-11)
|
|
339
|
-
|
|
340
|
-
### Fixes
|
|
341
|
-
|
|
342
|
-
* There was a caching issue that caused a flood of requests to the Schibsted account hasSession
|
|
343
|
-
endpoint. This is fixed in this release. Please update ASAP!
|
|
344
|
-
* The `Payment.purchaseCampaignFlowUrl` function used to have `null` as a default parameter for some
|
|
345
|
-
parameters that were required. This signature has been updated to match the documentation
|
|
346
|
-
|
|
347
|
-
### Other changes
|
|
348
|
-
|
|
349
|
-
* Documentation updates
|
|
350
|
-
|
|
351
|
-
## v3.0.0-rc.6 (2018-06-25)
|
|
352
|
-
|
|
353
|
-
### Breaking changes
|
|
354
|
-
|
|
355
|
-
* The `Identity.agreementUrl` has been removed. This function called an endpoint on the Schibsted
|
|
356
|
-
account backend that will be removed due to GDPR, and so it makes no sense to keep it in the SDK.
|
|
357
|
-
|
|
358
|
-
### Other fixes
|
|
359
|
-
|
|
360
|
-
* Some (mostly trivial) documentation polish here and there
|
|
361
|
-
|
|
362
|
-
## v3.0.0-rc.5 (2018-06-21)
|
|
363
|
-
|
|
364
|
-
### Breaking changes
|
|
365
|
-
|
|
366
|
-
* The 'visitor' concept is being removed both from the Schibsted account backend and thus also from
|
|
367
|
-
the SDKs. This means that `Identity.getVisitorId` and all references to `visitor` including the
|
|
368
|
-
emitting of the `visitor` event is removed in this version. If you depend on it, now's the time to
|
|
369
|
-
stop doing that.
|
|
370
|
-
|
|
371
|
-
### Fixes
|
|
372
|
-
|
|
373
|
-
* The ES5 global file should now work correctly. Yeah — before, I once again failed to fix it, by
|
|
374
|
-
not making sure that the symbol `regeneratorRuntime` was bound to the `window` globally **before**
|
|
375
|
-
loading `Identity`, `Monetization` and `Payment`. Third time's the charm, though 🤞🏼
|
|
376
|
-
* Both `Identity.getUserId` and `Identity.getUserUuid` now behave according to their documentation,
|
|
377
|
-
which is to say that they reject the returned Promise if the user is logged in, but not connected
|
|
378
|
-
to this merchant.
|
|
379
|
-
* Two functions, `Identity.accountUrl` and `Identity.phonesUrl` did not take a `redirectUri`
|
|
380
|
-
parameter, causing the Schibsted account backend to render a default `Back to [Site]` link on that
|
|
381
|
-
web page. Now you should be able to pick any valid redirect uri here.
|
|
382
|
-
|
|
383
|
-
## v3.0.0-rc.4 (2018-05-29)
|
|
384
|
-
|
|
385
|
-
### Fixes
|
|
386
|
-
|
|
387
|
-
* [#37](https://github.com/schibsted/account-sdk-browser/issues/37) — The files in the `es5`
|
|
388
|
-
directory have been rewritten to CommonJS syntax (yes, like in the good 'ol days). I still don't
|
|
389
|
-
fully understand what was happening here, but at least now it seems like it works for people
|
|
390
|
-
* [#40](https://github.com/schibsted/account-sdk-browser/issues/40) — Events are now emitted from
|
|
391
|
-
Identity when a call to `hasSession()` used a cached value
|
|
392
|
-
* [#41](https://github.com/schibsted/account-sdk-browser/issues/41) — References to the global
|
|
393
|
-
`window` have all been wrapped in functions, so that it can be loaded in Server-side rendering
|
|
394
|
-
contexts
|
|
395
|
-
* The caching could fail if the cache time in milliseconds were greater than `2^31 - 1` (just under
|
|
396
|
-
25 days). This has been fixed by capping the cache time to that maximum value
|
|
397
|
-
|
|
398
|
-
### Changes
|
|
399
|
-
|
|
400
|
-
* Documentation for the `Identity` class has been updated
|
|
401
|
-
|
|
402
|
-
## v3.0.0-rc.3 (2018-05-14)
|
|
403
|
-
|
|
404
|
-
### Fixes
|
|
405
|
-
|
|
406
|
-
* [#38](https://github.com/schibsted/account-sdk-browser/issues/38) — Source maps are now included
|
|
407
|
-
for generated ES5 files
|
|
408
|
-
* [#22](https://github.com/schibsted/account-sdk-browser/issues/22) — Documented that varnish
|
|
409
|
-
cookies need an Origin that is `!== localhost` for the logic to work in most (all?) browsers
|
|
410
|
-
* [#21](https://github.com/schibsted/account-sdk-browser/issues/21) — Fix documentation issue on
|
|
411
|
-
`Monetization.hasProduct` and `Monetization.hasSubscription`
|
|
412
|
-
|
|
413
|
-
### Changes
|
|
414
|
-
|
|
415
|
-
* Documentation (the main README.md file) has been updated to point to the SDK Example project in
|
|
416
|
-
case people might want to go look at it
|
|
417
|
-
* Be more explicit about the browsers supported in our ES5 generated files. In package.json for
|
|
418
|
-
those who are curious
|
|
419
|
-
|
|
420
|
-
## v3.0.0-rc.2 (2018-04-30)
|
|
421
|
-
|
|
422
|
-
### Fixes
|
|
423
|
-
|
|
424
|
-
* [#31](https://github.com/schibsted/account-sdk-browser/issues/31) — Our internal helper function
|
|
425
|
-
`urlMapper` now doesn't perform calls like `new URL('PRE')` without first checking if `'PRE'` is a
|
|
426
|
-
key in our url map object. This should ensure that outdated browsers like IE11 (that require a
|
|
427
|
-
polyfill for WHATWG `URL`) don't get flustered in this scenario.
|
|
428
|
-
|
|
429
|
-
## v3.0.0-rc.1 (2018-04-24)
|
|
430
|
-
|
|
431
|
-
### Breaking changes
|
|
432
|
-
|
|
433
|
-
* [#24](https://github.com/schibsted/account-sdk-browser/issues/24) — Change from CommonJS to ES
|
|
434
|
-
Modules syntax (that is — change from require/module.exports to using import/export syntax). Yeah,
|
|
435
|
-
this is a change that touched basically all the files in the whole project, but shouldn't really
|
|
436
|
-
change the usage much. It **is** a breaking change for some people using the CommonJS format. If
|
|
437
|
-
you find yourself in this group, your change should be:
|
|
438
|
-
|
|
439
|
-
// from when you were using rc.0 or older:
|
|
440
|
-
const Identity = require('@schibsted/account-sdk-browser/identity')
|
|
441
|
-
|
|
442
|
-
// to now, using rc.1:
|
|
443
|
-
const { Identity } = require('@schibsted/account-sdk-browser/identity')
|
|
444
|
-
|
|
445
|
-
If you already used the syntax `const { Identity } = require('@schibsted/account-sdk-browser')`
|
|
446
|
-
(that is — not the bundle-optimized version), then no change should be necessary
|
|
447
|
-
|
|
448
|
-
### Fixes
|
|
449
|
-
|
|
450
|
-
* [#23](https://github.com/schibsted/account-sdk-browser/issues/23) — The `Identity.logout()` docs
|
|
451
|
-
should now be up to date
|
|
452
|
-
* An internal usage of fetch was failing and has been fixed. It could cause the `Identity.logout()`
|
|
453
|
-
function to not clear all of its cookies. In the worst case, this could in turn cause the browser
|
|
454
|
-
to be confused about whether a user was logged in or not
|
|
455
|
-
|
|
456
|
-
### Changes
|
|
457
|
-
|
|
458
|
-
* The documentation has been updated to have more details about how `redirectUri` is different
|
|
459
|
-
between the old 2.x versions of the SDK and this 3.x version. Also, a section on the OpenID
|
|
460
|
-
Connect parameter `state` has been added
|
|
461
|
-
|
|
462
|
-
## v3.0.0-rc.0 (2018-04-10)
|
|
463
|
-
|
|
464
|
-
### Breaking changes
|
|
465
|
-
|
|
466
|
-
* The function `Identity.getUserUuidId` is renamed to `Identity.getUserUuid`. This was a typo in the
|
|
467
|
-
previous function name that was not detected until now :-/
|
|
468
|
-
* The function `Identity.getSpId` now returns `string|null` instead of `string|undefined`.
|
|
469
|
-
|
|
470
|
-
### Fixes
|
|
471
|
-
|
|
472
|
-
* The Identity class now clears its internal cache if `enableVarnishCookie()` is called. Previously,
|
|
473
|
-
calling `hasSession` after calling `enableVarnishCookie` would re-use any cached value and thus
|
|
474
|
-
skip setting the varnish cookie.
|
|
475
|
-
|
|
476
|
-
### Changes
|
|
477
|
-
|
|
478
|
-
* The function `Identity.getVisitorId` is now marked `async` in the codebase. It always returned a
|
|
479
|
-
Promise, so functionally it does the same as before. Syntax has just been modernised.
|
|
480
|
-
|
|
481
|
-
## v3.0.0-beta.7 (2018-04-03)
|
|
482
|
-
|
|
483
|
-
### Fixes
|
|
484
|
-
|
|
485
|
-
* Webpack options needed tweaking, so -beta.6 didn't work at all. The code in this version is
|
|
486
|
-
otherwise identical to -beta.6, so the `build.sh` script has the only change.
|
|
487
|
-
|
|
488
|
-
## v3.0.0-beta.6 (2018-04-03) — removed from npm, didn't work
|
|
489
|
-
|
|
490
|
-
### New features
|
|
491
|
-
|
|
492
|
-
* ES5 generation has been added. This is an opt-in feature, so a user can do:
|
|
493
|
-
|
|
494
|
-
// Either 1)
|
|
495
|
-
const Account = require('@schibsted/account-sdk-browser');
|
|
496
|
-
// ... or 2)
|
|
497
|
-
const Account = require('@schibsted/account-sdk-browser/es5');
|
|
498
|
-
|
|
499
|
-
// The shortcuts work as well (if you only want Identity stuff, for instance):
|
|
500
|
-
const Identity = require('@schibsted/account-sdk-browser/es5/identity');
|
|
501
|
-
|
|
502
|
-
### Changes
|
|
503
|
-
|
|
504
|
-
* Removed `parcel-bundler` and started using `webpack` instead. This was done to ease the production
|
|
505
|
-
of ES5 code
|
|
506
|
-
|
|
507
|
-
## v3.0.0-beta.5 (2018-03-21)
|
|
508
|
-
|
|
509
|
-
### Fixes
|
|
510
|
-
|
|
511
|
-
* An issue where `Identity.hasSession` would call the backend server(s) with a wrong autologin
|
|
512
|
-
parameter has been fixed. This could potentially cause the user to not be auto-logged-in when they
|
|
513
|
-
were supposed to be
|
|
514
|
-
|
|
515
|
-
## v3.0.0-beta.4 (2018-03-19)
|
|
516
|
-
|
|
517
|
-
### New features
|
|
518
|
-
|
|
519
|
-
* There is only one change in this release, and that is the addition of a `loginHint` parameter on
|
|
520
|
-
the `Indentity.login()` and `Identity.loginUrl()` functions. This enables the caller to pre-fill
|
|
521
|
-
the user identifier (email or phone number)
|
|
522
|
-
|
|
523
|
-
## v3.0.0-beta.3 (2018-03-16)
|
|
524
|
-
|
|
525
|
-
### Fixes
|
|
526
|
-
|
|
527
|
-
* Issue #8 is fixed by not relying on URLSearchParams to create query strings.
|
|
528
|
-
|
|
529
|
-
## v3.0.0-beta.2 (2018-03-09)
|
|
530
|
-
|
|
531
|
-
This release has only one notable change, and it is the fix from [this
|
|
532
|
-
PR](https://github.com/schibsted/account-sdk-browser/pull/7) so we correctly fall back to calling
|
|
533
|
-
SPiD when a call to the hasSession service fails with a LoginException. Thanks to Terje Andersen who
|
|
534
|
-
found and helped to identify this issue.
|
|
535
|
-
|
|
536
|
-
## v3.0.0-beta.1 (2018-03-06)
|
|
537
|
-
|
|
538
|
-
This is the initial public release. Hello, world!
|
package/NOTICE
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#########################################################
|
|
2
|
-
# #
|
|
3
|
-
# Schibsted account SDK for browsers #
|
|
4
|
-
# Copyright (c) 2018 Schibsted Products & Technology AS #
|
|
5
|
-
# #
|
|
6
|
-
#########################################################
|
|
7
|
-
|
|
8
|
-
This SDK depends on the following projects (each of which have zero dependencies of their own):
|
|
9
|
-
|
|
10
|
-
# SCHIBSTED ACCOUNT SDK DEPENDENCIES
|
|
11
|
-
|
|
12
|
-
fetch-jsonp
|
|
13
|
-
LICENSE: MIT,
|
|
14
|
-
https://github.com/camsong/fetch-jsonp/blob/master/README.md#license
|
|
15
|
-
|
|
16
|
-
tiny-emitter
|
|
17
|
-
LICENSE: MIT,
|
|
18
|
-
https://github.com/scottcorgan/tiny-emitter/blob/master/LICENSE
|
|
19
|
-
|