@schibsted/account-sdk-browser 4.6.0 → 4.7.2

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/es5/index.js CHANGED
@@ -976,8 +976,7 @@ var _require = __webpack_require__(174),
976
976
  * be mixed as space-separated string. To make sure that user has authenticated with 2FA you need
977
977
  * to verify AMR (Authentication Methods References) claim in ID token.
978
978
  * Might also be used to ensure additional acr (sms, otp) for already logged in users.
979
- * Supported values are also 'otp-email' means one time password using email, and 'otp-sms' means
980
- * one time password using sms.
979
+ * Supported value is also 'otp-email' means one time password using email.
981
980
  * @property {string} [scope] - The OAuth scopes for the tokens. This is a list of
982
981
  * scopes, separated by space. If the list of scopes contains `openid`, the generated tokens
983
982
  * includes the id token which can be useful for getting information about the user. Omitting
@@ -1012,8 +1011,7 @@ var _require = __webpack_require__(174),
1012
1011
  * be mixed as space-separated string. To make sure that user has authenticated with 2FA you need
1013
1012
  * to verify AMR (Authentication Methods References) claim in ID token.
1014
1013
  * Might also be used to ensure additional acr (sms, otp) for already logged in users.
1015
- * Supported values are also 'otp-email' means one time password using email, and 'otp-sms' means
1016
- * one time password using sms.
1014
+ * Supported value is also 'otp-email' means one time password using email.
1017
1015
  * @property {string} [scope] - The OAuth scopes for the tokens. This is a list of
1018
1016
  * scopes, separated by space. If the list of scopes contains `openid`, the generated tokens
1019
1017
  * includes the id token which can be useful for getting information about the user. Omitting
@@ -2093,10 +2091,10 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
2093
2091
  }
2094
2092
 
2095
2093
  var isValidAcrValue = function isValidAcrValue(acrValue) {
2096
- return Object(_validate__WEBPACK_IMPORTED_MODULE_21__["isStrIn"])(acrValue, ['password', 'otp', 'sms', 'eid-no', 'eid-se', 'eid'], true);
2094
+ return Object(_validate__WEBPACK_IMPORTED_MODULE_21__["isStrIn"])(acrValue, ['password', 'otp', 'sms', 'eid-no', 'eid-se', 'eid-fi', 'eid'], true);
2097
2095
  };
2098
2096
 
2099
- Object(_validate__WEBPACK_IMPORTED_MODULE_21__["assert"])(!acrValues || Object(_validate__WEBPACK_IMPORTED_MODULE_21__["isStrIn"])(acrValues, ['', 'otp-email', 'otp-sms'], true) || acrValues.split(' ').every(isValidAcrValue), "The acrValues parameter is not acceptable: ".concat(acrValues));
2097
+ Object(_validate__WEBPACK_IMPORTED_MODULE_21__["assert"])(!acrValues || Object(_validate__WEBPACK_IMPORTED_MODULE_21__["isStrIn"])(acrValues, ['', 'otp-email'], true) || acrValues.split(' ').every(isValidAcrValue), "The acrValues parameter is not acceptable: ".concat(acrValues));
2100
2098
  Object(_validate__WEBPACK_IMPORTED_MODULE_21__["assert"])(Object(_validate__WEBPACK_IMPORTED_MODULE_21__["isUrl"])(redirectUri), "loginUrl(): redirectUri must be a valid url but is ".concat(redirectUri));
2101
2099
  Object(_validate__WEBPACK_IMPORTED_MODULE_21__["assert"])(Object(_validate__WEBPACK_IMPORTED_MODULE_21__["isNonEmptyString"])(state), "the state parameter should be a non empty string but it is ".concat(state));
2102
2100
  return this._oauthService.makeUrl('oauth/authorize', {
@@ -2140,7 +2138,7 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
2140
2138
  key: "accountUrl",
2141
2139
  value: function accountUrl() {
2142
2140
  var redirectUri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.redirectUri;
2143
- return this._spid.makeUrl('account/summary', {
2141
+ return this._spid.makeUrl('profile-pages', {
2144
2142
  response_type: 'code',
2145
2143
  redirect_uri: redirectUri
2146
2144
  });
@@ -2155,7 +2153,7 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
2155
2153
  key: "phonesUrl",
2156
2154
  value: function phonesUrl() {
2157
2155
  var redirectUri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.redirectUri;
2158
- return this._spid.makeUrl('account/phones', {
2156
+ return this._spid.makeUrl('profile-pages/about-you/phone', {
2159
2157
  response_type: 'code',
2160
2158
  redirect_uri: redirectUri
2161
2159
  });
@@ -2250,6 +2248,10 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
2250
2248
  }
2251
2249
  };
2252
2250
 
2251
+ if (options && options.locale) {
2252
+ initialParams.locale = options.locale;
2253
+ }
2254
+
2253
2255
  var loginHandler = /*#__PURE__*/function () {
2254
2256
  var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
2255
2257
  return regeneratorRuntime.wrap(function _callee10$(_context10) {
@@ -11520,7 +11522,7 @@ function emulate(global) {
11520
11522
  /* 174 */
11521
11523
  /***/ (function(module) {
11522
11524
 
11523
- module.exports = JSON.parse("{\"name\":\"@schibsted/account-sdk-browser\",\"version\":\"4.6.0\",\"description\":\"Schibsted account SDK for browsers\",\"main\":\"index.js\",\"scripts\":{\"build\":\"./build.sh\",\"clean\":\"rimraf .cache coverage dist docs\",\"docs\":\"rimraf docs && jsdoc -c ./utils/jsdoc.js --verbose\",\"lint\":\"eslint .\",\"pretest\":\"npm run lint\",\"test\":\"jest\",\"precover\":\"npm run lint\",\"cover\":\"jest --coverage\",\"postcover\":\"codecov\"},\"author\":\"\",\"license\":\"MIT\",\"dependencies\":{\"tiny-emitter\":\"^2.1.0\"},\"devDependencies\":{\"@babel/core\":\"^7.11.4\",\"@babel/preset-env\":\"^7.11.0\",\"babel-loader\":\"^8.1.0\",\"codecov\":\"^3.6.5\",\"core-js\":\"^3.6.5\",\"docdash\":\"git+https://github.com/torarvid/docdash.git#v0.5.0\",\"eslint\":\"^6.8.0\",\"eslint-plugin-import\":\"^2.20.2\",\"jest\":\"^26.4.2\",\"jest-junit\":\"^10.0.0\",\"jsdoc\":\"^3.6.5\",\"node-fetch\":\"^2.6.0\",\"regenerator-runtime\":\"^0.13.7\",\"webpack\":\"^4.44.1\",\"webpack-cli\":\"^3.3.12\",\"whatwg-url\":\"^8.0.0\"},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/schibsted/account-sdk-browser.git\"},\"babel\":{\"presets\":[[\"@babel/preset-env\",{\"useBuiltIns\":\"usage\",\"corejs\":3,\"targets\":{\"browsers\":[\"> 1%\",\"last 10 chrome major versions\",\"last 10 firefox major versions\",\"last 10 opera major versions\",\"last 2 safari major versions\",\"last 2 ios major versions\",\"last 2 ie major versions\",\"last 5 edge major versions\"]}}]]},\"typings\":\"index.d.ts\"}");
11525
+ module.exports = JSON.parse("{\"name\":\"@schibsted/account-sdk-browser\",\"version\":\"4.7.2\",\"description\":\"Schibsted account SDK for browsers\",\"main\":\"index.js\",\"scripts\":{\"build\":\"./build.sh\",\"clean\":\"rimraf .cache coverage dist docs\",\"docs\":\"rimraf docs && jsdoc -c ./utils/jsdoc.js --verbose\",\"lint\":\"eslint .\",\"pretest\":\"npm run lint\",\"test\":\"jest\",\"precover\":\"npm run lint\",\"cover\":\"jest --coverage\",\"postcover\":\"codecov\"},\"author\":\"\",\"license\":\"MIT\",\"dependencies\":{\"tiny-emitter\":\"^2.1.0\"},\"devDependencies\":{\"@babel/core\":\"^7.11.4\",\"@babel/preset-env\":\"^7.11.0\",\"babel-loader\":\"^8.1.0\",\"codecov\":\"^3.6.5\",\"core-js\":\"^3.6.5\",\"docdash\":\"git+https://github.com/torarvid/docdash.git#v0.5.0\",\"eslint\":\"^6.8.0\",\"eslint-plugin-import\":\"^2.20.2\",\"jest\":\"^26.4.2\",\"jest-junit\":\"^10.0.0\",\"jsdoc\":\"^3.6.5\",\"node-fetch\":\"^2.6.0\",\"regenerator-runtime\":\"^0.13.7\",\"webpack\":\"^4.44.1\",\"webpack-cli\":\"^3.3.12\",\"whatwg-url\":\"^8.0.0\"},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/schibsted/account-sdk-browser.git\"},\"babel\":{\"presets\":[[\"@babel/preset-env\",{\"useBuiltIns\":\"usage\",\"corejs\":3,\"targets\":{\"browsers\":[\"> 1%\",\"last 10 chrome major versions\",\"last 10 firefox major versions\",\"last 10 opera major versions\",\"last 2 safari major versions\",\"last 2 ios major versions\",\"last 2 ie major versions\",\"last 5 edge major versions\"]}}]]},\"typings\":\"index.d.ts\"}");
11524
11526
 
11525
11527
  /***/ }),
11526
11528
  /* 175 */