- docs: dts update by @michal-oleniacz-stp in #263
- Add open & cancel events to SimplifiedLoginWidget by @michal-oleniacz-stp in #258
- [UUI-525] Feat: externalId by @michal-oleniacz-stp in #261
- 4.8.3 by @michal-oleniacz-stp in #262
- release 4.7.4 by @bogdan-niculescu-sch in #252
- Added readme on release process by @joawan in #254
- Fix lint warning by @joawan in #255
- Ignore malformed session storage objects
- Cleanup ReadMe
- Ignore malformed session storage objects
- Upgrade NodeJS used to build package from version 12 to 18
- Update path to Schibsted account profile pages.
- Add support for eID Finland
- Add locale support in the Simplified Login widget
- Add
eid
,eid-no
andeid-se
to valid acrValues
- Fix SimplifiedLoginWidgetLoginOptions typo
- Fix SimplifiedLoginWidgetLoginOptions
- .d.ts files publishing
- Add Danish env
options
param inshowSimplifiedLoginWidget
function is optional in Typescript now
- Added optional
options
param toshowSimplifiedLoginWidget
function, allowing to specify widgetencoding
- Add
not you?
button to simplified login widget
- Fix TS issues
- Add Finnish env
- Add .d.ts files
sessionDomain
is required- Removed
siteSpecificLogout
param- there is no option to disable site specific logout hasSession
does not acceptautologin
param anymore- Drop
hasProduct
andhasSubscription
functions- replaced byhasAccess
- Add 2FA Support- new
acrValues
:sms
,otp
,password
logSettings
function
- babel has been updated to
^7.11
- showSimplifiedLoginWidget accepts async function as state param - will be called only if user click log in
- Support for pulse providerId in simplified login widget
- Added
clearCachedAccessResult
andclearCachedUserSession
methods
- hasAccess - function that check if you have access to productsIds
- Cache 400 http responses from session service
- showSimplifiedLoginWidget - function that loads and displays simplified login widget
- Use sessionStorage as identity cache instead of localStorage
- Enable siteSpecificLogout by default
- Refactor hasSession to fix ie11 bug
- Enable site specific logout by default- it is experimental feature for now
- Update PublicUserData type description
- New method getUserContextData
- siteSpecificLogout flag (default false). When enabled, logout will logout user from local session-service, but not from Schibsted Account
- Do not display ITP dialog when session service is enabled
- Mark purchasePaylinkUrl as depracated
- Use
reject
in hasSessionpromiseFn
- Add
oneStepLogin
option tologin
function. If set totrue
username and password will be display on one page - Introduce
purchasePromoCodeProductFlowUrl
- function returns url for zuora subscription flow
- Add possibility to set SP_ID cookie domain with enableVarnishCookie function param
- Fix LOCAL SDRN namespace
- Silent error on Object.assign in SDKError for ios 9
- Update jest
- Fix LOCAL SDRN namespace
- fix typeof in clearVarnishCookie
- Monetization functions
hasProduct
andhasSubscription
didn't list@throws
in the docs, even though there was always a chance of those functions throwing SDKError if anything went wrong during a network call. Also, thespId
parameter is back to being a required parameter, since it's used when caching results (and without it, cache data could in theory span different users)
- Monetization functions
hasProduct
andhasSubscription
now fall back to calling the Schibsted account backend if a call to the session-service fails with a 400 error (meaning a session-cookie is not present).
- Monetization functions
hasProducts
andhasSubscription
now caches both failures (for 10 seconds) and successes (for 1 hour)
- Setting a Varnish cookie (the
SP_ID
cookie) will now be done with a top-level domain as the domain value. So if done from some.sub.site.example, we will usedomain=site.example
. Thanks to @olekenneth for fixing it
- If you are using the session-service, calls to
Identity.hasSession
will not return the obsoleteuserStatus
orid
fields (the numericuserId
and theuuid
fields are still returned). - Calling
Identity.hasSession
multiple times will now cause only one network call. While this call is running, other calls toIdentity.hasSession
will simply wait for that call to complete, and then they will all resolve to the same result
- We can communicate with the session-service instead of Schibsted account in
Identity.hasSession
,Monetization.hasProduct
andMonetization.hasSubscription
(quick howto; to opt into this, add a paramsessionDomain: 'https://id.site.example'
to the constructor for Identity and Monetization)
- The
Identity.logout()
function is no longer anasync
function, and now does a full-page redirect to the Schibsted account domain to log the user out. This is because we can't trust that the XHR way of logging people out will work for Safari 12 users. Sorry for the breaking change, but at least it works in a consistent way. It now also takes a parameterredirectUri
that defaults to theredirectUri
from theIdentity
constructor. The browser will be redirected there after Schibsted account has logged the user out
- Varnish cookie fixes: 1) The localstorage item was wrongly cleared when calling
Identity.enableVarnishCookie()
, and 2) The varnish cookie was not removed correctly when callingIdentity.logout()
.
- ITP: Set the z-index of the ITP dialog to a "zooper high value" to 🤞🏼 ensure 🤞🏼 that it hovers above the main site content
- Support for new
Identity.login
parameters:tag
,teaser
andmaxAge
- ITP: There are explicit methods in Identity for users that don't use the
login
method. See the docs for showItpModalUponReturning and suppressItpModal if you're interested
- The
Identity.loginUrl
method used to take a lot of arguments, and with this release it was about to become even more (with the addedtag
,teaser
andmaxAge
params mentioned above). This release changes the signature to have a singleoptions
object instead of the argument list. In this case we made it backwards-compatible, so it won't break (YET!) if you continue using an argument list. Beware though, that passing a list of arguments is considered DEPRECATED as of now - The es5 folder now contains both minified and unminified code. The minified ones have the
.min.js
suffix. Before, only minified files were published, so if you're using those, you might suddenly have bigger files than you did before. Sorry.. 🤷🏼
- #76 — Login on Chrome/iOS should now work once again
- The only change is adding a typings file to the
es5
folder. There are no functional changes from rc.13
- The "Safari 12 ITP2 workaround" from v3.0.0-rc.11 had a bug where we passed the wrong query
parameter to the ITP dialog, so the dialog then failed to post a message back to the parent page.
In conclusion; calls to
Identity.hasSession
would still fail 😭.
This release is identical to rc.11 but includes index.d.ts in the npm package.
- Initial support for Safari 12. For users of this browser, there could be issues related to
Intelligent Tracking Prevention (ITP) v2. For the people who experience it, it would be impossible
to detect whether you're logged in or not from a given site (because cookies to Schibsted account
would be blocked because it's a third party). The Apple way to solve this, is to call
requestStorageAccess
from an iframe, and let the user choose "Allow" in a scary Safari dialog. Then cookies will once more be allowed to go to that third party. This SDK will now work around this by showing a friendlier dialog before callingrequestStorageAccess
so people are hopefully more inclined to click "Allow".
- #68 — Cache was not cleared after
calling
Identity.logout()
orIdentity.enableVarnishCache
- Upgraded regenerator-runtime to fix this CSP issue (courtesy of @henninga)
- #64 — This issue was fixed in two
ways. First, by changing the implementation so we set the Varnish cookie on every call to
hasSession
(before we didn't do so when ahasSession
returned cached data). Second, we introduced an optional parameterexpiresIn
on theIdentity.enableVarnishCookie
where you can override the default expiry of the Varnish cookie. - #54 — Ensure that we clear the Varnish cookie when a user logs out.
- Remove not logged in user cache on login call #62
- There was a caching issue that caused a flood of requests to the Schibsted account hasSession endpoint. This is fixed in this release. Please update ASAP!
- The
Payment.purchaseCampaignFlowUrl
function used to havenull
as a default parameter for some parameters that were required. This signature has been updated to match the documentation
- Documentation updates
- The
Identity.agreementUrl
has been removed. This function called an endpoint on the Schibsted account backend that will be removed due to GDPR, and so it makes no sense to keep it in the SDK.
- Some (mostly trivial) documentation polish here and there
- The 'visitor' concept is being removed both from the Schibsted account backend and thus also from
the SDKs. This means that
Identity.getVisitorId
and all references tovisitor
including the emitting of thevisitor
event is removed in this version. If you depend on it, now's the time to stop doing that.
- The ES5 global file should now work correctly. Yeah — before, I once again failed to fix it, by
not making sure that the symbol
regeneratorRuntime
was bound to thewindow
globally before loadingIdentity
,Monetization
andPayment
. Third time's the charm, though 🤞🏼 - Both
Identity.getUserId
andIdentity.getUserUuid
now behave according to their documentation, which is to say that they reject the returned Promise if the user is logged in, but not connected to this merchant. - Two functions,
Identity.accountUrl
andIdentity.phonesUrl
did not take aredirectUri
parameter, causing the Schibsted account backend to render a defaultBack to [Site]
link on that web page. Now you should be able to pick any valid redirect uri here.
- #37 — The files in the
es5
directory have been rewritten to CommonJS syntax (yes, like in the good 'ol days). I still don't fully understand what was happening here, but at least now it seems like it works for people - #40 — Events are now emitted from
Identity when a call to
hasSession()
used a cached value - #41 — References to the global
window
have all been wrapped in functions, so that it can be loaded in Server-side rendering contexts - The caching could fail if the cache time in milliseconds were greater than
2^31 - 1
(just under 25 days). This has been fixed by capping the cache time to that maximum value
- Documentation for the
Identity
class has been updated
- #38 — Source maps are now included for generated ES5 files
- #22 — Documented that varnish
cookies need an Origin that is
!== localhost
for the logic to work in most (all?) browsers - #21 — Fix documentation issue on
Monetization.hasProduct
andMonetization.hasSubscription
- Documentation (the main README.md file) has been updated to point to the SDK Example project in case people might want to go look at it
- Be more explicit about the browsers supported in our ES5 generated files. In package.json for those who are curious
- #31 — Our internal helper function
urlMapper
now doesn't perform calls likenew URL('PRE')
without first checking if'PRE'
is a key in our url map object. This should ensure that outdated browsers like IE11 (that require a polyfill for WHATWGURL
) don't get flustered in this scenario.
-
#24 — Change from CommonJS to ES Modules syntax (that is — change from require/module.exports to using import/export syntax). Yeah, this is a change that touched basically all the files in the whole project, but shouldn't really change the usage much. It is a breaking change for some people using the CommonJS format. If you find yourself in this group, your change should be:
// from when you were using rc.0 or older: const Identity = require('@schibsted/account-sdk-browser/identity') // to now, using rc.1: const { Identity } = require('@schibsted/account-sdk-browser/identity')
If you already used the syntax
const { Identity } = require('@schibsted/account-sdk-browser')
(that is — not the bundle-optimized version), then no change should be necessary
- #23 — The
Identity.logout()
docs should now be up to date - An internal usage of fetch was failing and has been fixed. It could cause the
Identity.logout()
function to not clear all of its cookies. In the worst case, this could in turn cause the browser to be confused about whether a user was logged in or not
- The documentation has been updated to have more details about how
redirectUri
is different between the old 2.x versions of the SDK and this 3.x version. Also, a section on the OpenID Connect parameterstate
has been added
- The function
Identity.getUserUuidId
is renamed toIdentity.getUserUuid
. This was a typo in the previous function name that was not detected until now :-/ - The function
Identity.getSpId
now returnsstring|null
instead ofstring|undefined
.
- The Identity class now clears its internal cache if
enableVarnishCookie()
is called. Previously, callinghasSession
after callingenableVarnishCookie
would re-use any cached value and thus skip setting the varnish cookie.
- The function
Identity.getVisitorId
is now markedasync
in the codebase. It always returned a Promise, so functionally it does the same as before. Syntax has just been modernised.
- Webpack options needed tweaking, so -beta.6 didn't work at all. The code in this version is
otherwise identical to -beta.6, so the
build.sh
script has the only change.
-
ES5 generation has been added. This is an opt-in feature, so a user can do:
// Either 1) const Account = require('@schibsted/account-sdk-browser'); // ... or 2) const Account = require('@schibsted/account-sdk-browser/es5'); // The shortcuts work as well (if you only want Identity stuff, for instance): const Identity = require('@schibsted/account-sdk-browser/es5/identity');
- Removed
parcel-bundler
and started usingwebpack
instead. This was done to ease the production of ES5 code
- An issue where
Identity.hasSession
would call the backend server(s) with a wrong autologin parameter has been fixed. This could potentially cause the user to not be auto-logged-in when they were supposed to be
- There is only one change in this release, and that is the addition of a
loginHint
parameter on theIndentity.login()
andIdentity.loginUrl()
functions. This enables the caller to pre-fill the user identifier (email or phone number)
- Issue #8 is fixed by not relying on URLSearchParams to create query strings.
This release has only one notable change, and it is the fix from this PR so we correctly fall back to calling SPiD when a call to the hasSession service fails with a LoginException. Thanks to Terje Andersen who found and helped to identify this issue.
This is the initial public release. Hello, world!