Add option to disable authentication in designer

This commit is contained in:
Sipke Schoorstra 2023-05-19 14:37:03 +02:00
parent 5ef8fd4ffd
commit 36ba56db18
2 changed files with 4 additions and 1 deletions

View file

@ -264,6 +264,7 @@ export namespace Components {
"tabs": Array<TabDefinition>;
}
interface ElsaStudio {
"disableAuth": boolean;
"enableFlexiblePorts": boolean;
"monacoLibPath": string;
"serverUrl": string;
@ -1234,6 +1235,7 @@ declare namespace LocalJSX {
"tabs"?: Array<TabDefinition>;
}
interface ElsaStudio {
"disableAuth"?: boolean;
"enableFlexiblePorts"?: boolean;
"monacoLibPath"?: string;
"serverUrl"?: string;

View file

@ -26,6 +26,7 @@ export class Studio {
@Prop({attribute: 'server'}) serverUrl: string;
@Prop({attribute: 'monaco-lib-path'}) monacoLibPath: string;
@Prop({attribute: 'enable-flexible-ports'}) enableFlexiblePorts: boolean;
@Prop({attribute: 'disable-auth'}) disableAuth: boolean;
@Watch('serverUrl')
private handleServerUrl(value: string) {
@ -49,7 +50,7 @@ export class Studio {
// If we have a valid session, emit the signed in event so that descriptors will be loaded.
const authContext = Container.get(AuthContext);
if (authContext.getIsSignedIn()) {
if (this.disableAuth || authContext.getIsSignedIn()) {
const eventBus = Container.get(EventBus);
await eventBus.emit(EventTypes.Auth.SignedIn)
}