VirtoCommerce/vc-platform

vue-starter-theme after change the APP_BACKEND_URL return error

six006 opened this issue · 5 comments

vc-platform:3.204.0
vue-starter-theme:dev 2022-03-02
vc-storefront:5.8.1

change the vue-starter-theme/.env content
if APP_BACKEND_URL is https://st-storefront.dev.govirto.com return success.
if APP_BACKEND_URL is http://localhost:10645 return error,

#APP_BACKEND_URL=https://st-storefront.dev.govirto.com
APP_BACKEND_URL=http://localhost:10645

VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en

image

image

image

after install VirtoCommerce.ProfileExperienceApiModule module solve this problem
image

but when open the url it return another GraphQL error

{"errors":[{"message":"GraphQL.Execution.UnhandledError: Error trying to resolve field 'cart'.\r\n ---> System.ArgumentNullException: Value cannot be null. (Parameter 'principal')\r\n   at System.Security.Claims.PrincipalExtensions.FindFirstValue(ClaimsPrincipal principal, String claimType)\r\n   at VirtoCommerce.Platform.Security.Authorization.PermissionAuthorizationHandlerBase`1.HandleRequirementAsync(AuthorizationHandlerContext context, TRequirement requirement) in E:\\VirtoCommerce\\5.Source\\vc-platform-3.204.0\\src\\VirtoCommerce.Platform.Security\\Authorization\\PermissionAuthorizationHandlerBase.cs:line 15\r\n   at Microsoft.AspNetCore.Authorization.AuthorizationHandler`1.HandleAsync(AuthorizationHandlerContext context)\r\n   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, IEnumerable`1 requirements)\r\n   at VirtoCommerce.XPurchase.Schemas.PurchaseSchema.CheckAccessToCartAsync(IResolveFieldContext context, ShoppingCart cart) in /home/runner/work/vc-module-experience-api/vc-module-experience-api/src/XPurchase/VirtoCommerce.XPurchase/Schemas/PurchaseSchema.cs:line 1230\r\n   at VirtoCommerce.XPurchase.Schemas.PurchaseSchema.<Build>b__6_37(IResolveFieldContext context) in /home/runner/work/vc-module-experience-api/vc-module-experience-api/src/XPurchase/VirtoCommerce.XPurchase/Schemas/PurchaseSchema.cs:line 85\r\n   at GraphQL.Execution.ExecutionStrategy.ExecuteNodeAsync(ExecutionContext context, ExecutionNode node) in /_/src/GraphQL/Execution/ExecutionStrategy.cs:line 429\r\n   --- End of inner exception stack trace ---","locations":[{"line":2,"column":3}],"path":["cart"],"extensions":{"code":"ARGUMENT_NULL","codes":["ARGUMENT_NULL"]}}],"data":{"cart":null}}

image

This error means you haven’t Profile support in the XAPI layer.

To fix this error the VirtoCommerce.ProfileExperienceApiModule module with version at least 3.201 is required.

@DanilBayushev thanks .I have sovle the getMe query GraphQL problem.But the cart query GraphQL error happend.I open a new issue about this.