Add option to disable authentication in designer
This commit is contained in:
parent
5ef8fd4ffd
commit
36ba56db18
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue