@schibsted/account-sdk-browser 5.1.1 → 5.2.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
@@ -61,14 +61,13 @@ You can use that code as inspiration or just fork and play with it. The account-
61
61
  module is used for authenticating the user with Schibsted account. Take a look at how the SDK is
62
62
  initialized.
63
63
 
64
- When a user wants to log in to your site, you direct them to a UI flow that is hosted by Schibsted
65
- Account. We authenticate the user and redirect them back to your site. This final redirect back to
66
- your site is done in accordance with the OAuth2 spec. That means that we pass a `code` in the query
67
- string in that redirect uri. You can use that `code` on your site backend along with your client
68
- credentials (client id & secret) to get an *Access Token* (AT) and *Refresh Token* (RT). You don't
69
- send the AT (and never ever the RT!) to the browser but rather keep it on the server side and
70
- associate it with that particular user session in order to be able to call Schibsted account APIs on
71
- behalf of that user.
64
+ When a user wants to log in to your site, you direct them to a UI flow hosted by **Schibsted Account**.
65
+ We authenticate the user and redirect them back to your site. This final redirect back to your site is performed in accordance with the OAuth2 specification.
66
+ This means we pass a `code` in the query string of that redirect URI.
67
+ You can use that `code` on your site's backend, along with your client credentials (client ID and secret), to obtain an *Access Token* (AT) and a *Refresh Token* (RT).
68
+ You should not send the AT (and **never** the RT!) to the browser. Instead, keep them on the server side and associate them with the specific user session.
69
+ This allows you to call Schibsted Account APIs on behalf of that user.
70
+
72
71
 
73
72
  ## Events
74
73
 
package/es5/global.js CHANGED
@@ -2938,6 +2938,7 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
2938
2938
  * @param {string} [options.locale]
2939
2939
  * @param {boolean} [options.oneStepLogin=false]
2940
2940
  * @param {string} [options.prompt=select_account]
2941
+ * @param {string} [options.xDomainId]
2941
2942
  * @return {Window|null} - Reference to popup window if created (or `null` otherwise)
2942
2943
  */
2943
2944
  }, {
@@ -2965,7 +2966,9 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
2965
2966
  _ref4$oneStepLogin = _ref4.oneStepLogin,
2966
2967
  oneStepLogin = _ref4$oneStepLogin === void 0 ? false : _ref4$oneStepLogin,
2967
2968
  _ref4$prompt = _ref4.prompt,
2968
- prompt = _ref4$prompt === void 0 ? 'select_account' : _ref4$prompt;
2969
+ prompt = _ref4$prompt === void 0 ? 'select_account' : _ref4$prompt,
2970
+ _ref4$xDomainId = _ref4.xDomainId,
2971
+ xDomainId = _ref4$xDomainId === void 0 ? '' : _ref4$xDomainId;
2969
2972
  this._closePopup();
2970
2973
  this.sessionStorageCache.delete(HAS_SESSION_CACHE_KEY);
2971
2974
  var url = this.loginUrl({
@@ -2979,7 +2982,8 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
2979
2982
  maxAge: maxAge,
2980
2983
  locale: locale,
2981
2984
  oneStepLogin: oneStepLogin,
2982
- prompt: prompt
2985
+ prompt: prompt,
2986
+ xDomainId: xDomainId
2983
2987
  });
2984
2988
  if (preferPopup) {
2985
2989
  this.popup = _popup_js__WEBPACK_IMPORTED_MODULE_61__["open"](this.window, url, 'Schibsted account', {
@@ -3085,7 +3089,9 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
3085
3089
  _ref5$oneStepLogin = _ref5.oneStepLogin,
3086
3090
  oneStepLogin = _ref5$oneStepLogin === void 0 ? false : _ref5$oneStepLogin,
3087
3091
  _ref5$prompt = _ref5.prompt,
3088
- prompt = _ref5$prompt === void 0 ? 'select_account' : _ref5$prompt;
3092
+ prompt = _ref5$prompt === void 0 ? 'select_account' : _ref5$prompt,
3093
+ _ref5$xDomainId = _ref5.xDomainId,
3094
+ xDomainId = _ref5$xDomainId === void 0 ? '' : _ref5$xDomainId;
3089
3095
  if (_typeof(arguments[0]) !== 'object') {
3090
3096
  // backward compatibility
3091
3097
  state = arguments[0];
@@ -3115,7 +3121,8 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
3115
3121
  max_age: maxAge,
3116
3122
  locale: locale,
3117
3123
  one_step_login: oneStepLogin || '',
3118
- prompt: acrValues ? '' : prompt
3124
+ prompt: acrValues ? '' : prompt,
3125
+ x_domain_id: xDomainId
3119
3126
  });
3120
3127
  }
3121
3128
 
@@ -12033,7 +12040,7 @@ __webpack_require__.r(__webpack_exports__);
12033
12040
 
12034
12041
 
12035
12042
 
12036
- var version = '5.1.1';
12043
+ var version = '5.2.0';
12037
12044
  /* harmony default export */ __webpack_exports__["default"] = (version);
12038
12045
 
12039
12046
  /***/ }),