@shopgate/pwa-webcheckout-shopify 7.12.3 → 7.20.0-beta.1

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/actions/login.js CHANGED
@@ -4,4 +4,4 @@ import HttpRequest from'@shopgate/pwa-core/classes/HttpRequest';import requestSh
4
4
  * @param {string} password The login password.
5
5
  * @return {Function} A redux thunk.
6
6
  */export default(function(user,password){return function(dispatch){if(!isShopify()){// The success is dispatched here to take care that the streams work as expected
7
- dispatch(successShopifyLogin());return;}dispatch(requestShopifyLogin());new HttpRequest("".concat(getShopifyUrl(),"/account/login")).setMethod('POST').setTimeout(20000).setPayload({form_type:'customer_login',customer:{email:user,password:password}}).dispatch().then(function(response){var _response$headers=response.headers;_response$headers=_response$headers===void 0?{}:_response$headers;var location=_response$headers.location,statusCode=response.statusCode;if(statusCode===302&&location&&location.endsWith('/account')){dispatch(successShopifyLogin());}else{dispatch(errorShopifyLogin());}})["catch"](function(){dispatch(errorShopifyLogin());});};});
7
+ dispatch(successShopifyLogin());return;}dispatch(requestShopifyLogin());new HttpRequest("".concat(getShopifyUrl(),"/account/login")).setMethod('POST').setTimeout(20000).setPayload({form_type:'customer_login',customer:{email:user,password:password}}).dispatch().then(function(response){var _response$headers=response.headers,_response$headers2=_response$headers===void 0?{}:_response$headers,location=_response$headers2.location,statusCode=response.statusCode;if(statusCode===302&&location&&location.endsWith('/account')){dispatch(successShopifyLogin());}else{dispatch(errorShopifyLogin());}})["catch"](function(){dispatch(errorShopifyLogin());});};});
package/actions/logout.js CHANGED
@@ -2,5 +2,5 @@ import HttpRequest from'@shopgate/pwa-core/classes/HttpRequest';import requestSh
2
2
  * Log out the current user.
3
3
  * @return {Function} A redux thunk.
4
4
  */export default(function(){return function(dispatch){var logoutUrl=getLogoutUrl();if(!logoutUrl){// When no logout url is available it doesn't make sense to do the request
5
- return;}dispatch(requestShopifyLogout());new HttpRequest(logoutUrl).dispatch().then(function(response){var _response$headers=response.headers;_response$headers=_response$headers===void 0?{}:_response$headers;var location=_response$headers.location,statusCode=response.statusCode;var logoutSuccessUrl=getLogoutSuccessUrl();// When a success url is available it needs to be considered at the response evaluation
5
+ return;}dispatch(requestShopifyLogout());new HttpRequest(logoutUrl).dispatch().then(function(response){var _response$headers=response.headers,_response$headers2=_response$headers===void 0?{}:_response$headers,location=_response$headers2.location,statusCode=response.statusCode;var logoutSuccessUrl=getLogoutSuccessUrl();// When a success url is available it needs to be considered at the response evaluation
6
6
  var urlCheckValid=!logoutSuccessUrl||location&&location.startsWith(logoutSuccessUrl);if(statusCode===302&&urlCheckValid){dispatch(successShopifyLogout());}else{dispatch(errorShopifyLogout());}})["catch"](function(){dispatch(errorShopifyLogout());});};});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-webcheckout-shopify",
3
- "version": "7.12.3",
3
+ "version": "7.20.0-beta.1",
4
4
  "description": "Webcheckout Shopify library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -17,8 +17,8 @@
17
17
  "connect"
18
18
  ],
19
19
  "devDependencies": {
20
- "@shopgate/pwa-common": "7.12.3",
21
- "@shopgate/pwa-core": "7.12.3",
20
+ "@shopgate/pwa-common": "7.20.0-beta.1",
21
+ "@shopgate/pwa-core": "7.20.0-beta.1",
22
22
  "react": "~16.12.0"
23
23
  }
24
24
  }