File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/commands/lightning/dev Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ Name of the Experience Builder site to preview. It has to match a site name from
2525
2626Download the latest version of the specified site from your org, instead of using any local cache.
2727
28+ # flags.guest.summary
29+
30+ Preview the site as a guest user (rather than an authenticated user),
31+
2832# examples
2933
3034- Select a site to preview from the org "myOrg":
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ export default class LightningDevSite extends SfCommand<void> {
3232 summary : messages . getMessage ( 'flags.get-latest.summary' ) ,
3333 char : 'l' ,
3434 } ) ,
35+ guest : Flags . boolean ( {
36+ summary : messages . getMessage ( 'flags.guest.summary' ) ,
37+ default : false ,
38+ } ) ,
3539 } ;
3640
3741 public async run ( ) : Promise < void > {
@@ -40,6 +44,7 @@ export default class LightningDevSite extends SfCommand<void> {
4044 try {
4145 const org = flags [ 'target-org' ] ;
4246 const getLatest = flags [ 'get-latest' ] ;
47+ const guest = flags . guest ;
4348 let siteName = flags . name ;
4449
4550 const connection = org . getConnection ( undefined ) ;
@@ -82,7 +87,7 @@ export default class LightningDevSite extends SfCommand<void> {
8287 this . log ( `[local-dev] launching browser preview for: ${ siteName } ` ) ;
8388
8489 // Establish a valid access token for this site
85- const authToken = await selectedSite . setupAuth ( ) ;
90+ const authToken = guest ? '' : await selectedSite . setupAuth ( ) ;
8691
8792 // Start the dev server
8893 const port = parseInt ( process . env . PORT ?? '3000' , 10 ) ;
You can’t perform that action at this time.
0 commit comments