on 2023 May 06 11:33 AM
Hi
I have enabled early login for my B2B site. I have not done any customization and using Hybris 2211 Version and Spartacus 5.2 V
Smart Edit will always be in a loading state as below. If I remove Early Login import it works fine. Is there anything else I need to do here?

Only Changes are done in the spartacus-configuration.module.ts file . I have added below smartedit configuration
storefrontPreviewRoute: 'cx-preview',
allowOrigin: 'localhost:9002',
and Early Login configuration
imports: [
ConfigModule.withConfig({
routing: {
/* ... */
protected : true,
routes: {
contact: {
paths: ['contact'],
protected: false, // make the contact route public
},
register: {
protected: false, // make the register route protected by overriding the `protected: false` configuration in `default-routing-config.ts`
},
},
},
}),
],
Below is the Complete File
import { NgModule } from '@angular/core';
import { translationChunksConfig, translations } from '@spartacus/assets';
import {
ConfigModule,
FeaturesConfig,
I18nConfig,
OccConfig,
provideConfig,
SiteContextConfig,
} from '@spartacus/core';
import { defaultB2bOccConfig } from '@spartacus/setup';
import { SmartEditConfig } from '@spartacus/smartedit/root';
import {
defaultCmsContentProviders,
layoutConfig,
mediaConfig,
} from '@spartacus/storefront';
@NgModule({
declarations: [],
imports: [
ConfigModule.withConfig({
routing: {
/* ... */
protected : true,
routes: {
contact: {
paths: ['contact'],
protected: false, // make the contact route public
},
register: {
protected: false, // make the register route protected by overriding the `protected: false` configuration in `default-routing-config.ts`
},
},
},
}),
],
providers: [
provideConfig(layoutConfig),
provideConfig(mediaConfig),
...defaultCmsContentProviders,
provideConfig(<OccConfig>{
backend: {
occ: {
baseUrl: 'https://localhost:9002',
},
},
}),
provideConfig(<SiteContextConfig>{
context: {
urlParameters: ['baseSite', 'language', 'currency'],
baseSite: ['powertools-spa'],
currency: ['USD', 'GBP'],
},
}),
provideConfig(<I18nConfig>{
i18n: {
resources: translations,
chunks: translationChunksConfig,
fallbackLang: 'en',
},
}),
provideConfig(<FeaturesConfig>{
features: {
level: '5.2',
},
}),
provideConfig(defaultB2bOccConfig),
provideConfig(<SmartEditConfig>{
smartEdit: {
storefrontPreviewRoute: 'cx-preview',
allowOrigin: 'localhost:9002',
},
}),
],
})
export class SpartacusConfigurationModule {}
sap commerce cloud - Missing Perspective Toolbar in SmartEdit in SPARTACUS 5.2 Version - Stack Overf...
Regards
Yashwanth
Request clarification before answering.
I tried to debug on why it was not working in Early login scenario.
I have identified the root cause is because that when the homepage loads in the smartEdit. The navigation will be " https://localhost:9002/cx-preview
Since cx-preview is not excluded from the protected list and call goes on a loop somewhere between AuthGuard and it never completes .
Hence if someone faces the same issue. Try the below solution as it worked for me
Exclude "cx-preview" from the protected list as shown below
cxpreview: {
paths: ['cx-preview'],
protected: false, // make the cx-preview smart edit route public
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to add it to the Spartacus configuration module file below inside the routes object.
imports: [
ConfigModule.withConfig({
routing: {
/* ... */
protected : true,
routes: {
contact: {
paths: ['contact'],
protected: false, // make the contact route public
},
register: {
protected: false, // make the register route protected by overriding the `protected: false` configuration in `default-routing-config.ts`
},
},
},
}),
],
Hello guys. I had the same issue with spartacus 6.0. I cheked spartacus-configuration.module.ts and remove not my allowOrigin: I kept local and dev env and Now it's working fine.
provideConfig({
backend: occConfig.backend,
smartEdit: {
storefrontPreviewRoute: 'cx-preview',
// TODO: adjust origins as necessary
allowOrigin: 'localhost:9002, *.*.my.dev.enviroment',
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I think this is a bug in composable storefront 5.2, you can try composable storefront 5.1, it should work.
Hopefully it can help you a little.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.