I did test in two Spartacus instances,one is setup locally, the other one is http://cx-qa.eastus.cloudapp.azure.com:4200/
- create a new storefront using Schematics with version 3.1.
OCC endpoint: https://20.51.210.49:9002/
Login with url http://localhost:4200/electronics-spa/en/USD/
Wait for 1 minute till the access token is expired.
Refresh the browser.
Login page is displayed. This is working as designed.
- login with http://cx.eastus.cloudapp.azure.com:4200/
Wait for 1 minute till the access token is expired.
Refresh the browser.
No login page is displayed. Instead, blank screen is displayed.
The cause of blank page is, the OCC API to retrieve CMS structure of login page fails with 400 response:
Because the url itself is wrong:
https://20.51.210.49:9002/occ/v2/cms/pages?pageType=ContentPage&pageLabelOrId=%2Flogin&lang=en&curr=USD
The base site is missing in url.
The correct url should be:
https://20.51.210.49:9002/occ/v2/electronics-spa/cms/pages?pageType=ContentPage&pageLabelOrId=%2Flogin&lang=en&curr=USD
Due to this error, pageStructure.page is undefined, and the code below leads to JavaScript error in console. The login page fails to display. Then blank screen.
But why http://localhost:4200/electronics-spa/en/USD/ can work as expected?
In Spartacus 3.1, there is no Authorization field appended to OCC API for base site request:
But in our QA instance, the access token is appended in API request headers, so 401 error occurs.
Due to this error, base site cannot be retrieved, so subsequent request for login page structure is failed as well. Finally no login page displayed.
Here is some specific debugging information.
http://cx.eastus.cloudapp.azure.com:4200/electronics-spa/en/USD/
This method is called by cms-page.connector.ts.
Read the context of the login page.
This request to read the page structure of the login page has succeeded.
Request parameters successfully read.
The context is now only PreHeader and SiteLogin.
On a properly working local Storefront, the basesite request returns success:
Read More:
- SAP Spartacus encountered an error in the background of Commerce cloud when using the product configuration function
- Google APIs of SAP Spartacus and ns of firebox_ BINDING_ Aborted error
- “Cannot access GitHub because this site uses HSTs.” Problem solving
- [Solved] Access /oauth/token in SpringCloud OAuth2 and report server_error
- About writing [if] and [else] statements in JSP, Syntax error on token “else”, delete this token
- SAP ABAP HTTPS installation certificate to SAP application server
- bug-JAVA call SAP function Connect to SAP gateway failed
- SAP development and error reporting: 500 SAP internal server error (TE rmination:RABAX_ STATE)
- egg.js The frame post request reported an error of invalid CSRF token security verification, which has been solved
- If the iframe in IE refers to the cross domain site page, the session fails
- Docker Nacos deployment uses container name to access 400 bad request
- remote: XXX Incorrect username or password (access token) fatal: Authentication failed for XXX
- [nodejs] error request aborted after request routing in post mode
- Token bucket implementation with adaptive token generation rate
- Coding and decoding Base64 in Python
- When SAP receives the goods, the system prompts that it can only be recorded in the period 2009 / 09 and 2009 / 08 of company code 1101
- request:fail url not in domain list or Cannot send network request to localhost
- In the HTML page request Ajax times 400 error, solve Yii submit post form 400 error, and Ajax post request 400 problem (example code)
- Error domain = nsurlerrordomain code = – 1001 “request timeout occurred in swift alamofire get request. ” UserInfo={NSUnderlyingErro
- Syntax error on token “}“, delete this token