Skip to content

Commit

Permalink
BC-7171 - TSC: Logout with open tldraw tab leads to wrong page (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergatco authored Dec 20, 2024
1 parent 75374c5 commit ed87499
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ S3_SSL=false
FEATURE_TLDRAW_ENABLED=true
TLDRAW_WEBSOCKET_URL=ws://localhost:3345

X_API_ALLOWED_KEYS=randomString
X_API_ALLOWED_KEYS=randomString

NOT_AUTHENTICATED_REDIRECT_URL=http://localhost:4000/login
4 changes: 3 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ FEATURE_TLDRAW_ENABLED=true
TLDRAW_WEBSOCKET_URL=ws://localhost:3399
TLDRAW_WEBSOCKET_PORT=3399

X_API_ALLOWED_KEYS=randomString
X_API_ALLOWED_KEYS=randomString

NOT_AUTHENTICATED_REDIRECT_URL=http://localhost:4000/login
3 changes: 2 additions & 1 deletion ansible/roles/tldraw-server/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ TLDRAW_ASSETS_ALLOWED_MIME_TYPES_LIST : "image/png,image/jpeg,image/gif,image/sv
TLDRAW_LOG_LEVEL: "error"
TLDRAW_METRICS_COLLECT_DEFAULT: "true"
TLDRAW_ASSETS_ENABLED: "true"
TLDRAW_WEBSOCKET_PATH: "/tldraw-server"
TLDRAW_WEBSOCKET_PATH: "/tldraw-server"
NOT_AUTHENTICATED_REDIRECT_URL: "https://{{ DOMAIN }}/login"
1 change: 1 addition & 0 deletions ansible/roles/tldraw-server/templates/configmap.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ data:
FEATURE_TLDRAW_ENABLED: "{{ FEATURE_TLDRAW_ENABLED }}"
TLDRAW_WEBSOCKET_PATH: "{{ TLDRAW_WEBSOCKET_PATH }}"
TLDRAW_WEBSOCKET_URL: "wss://{{ DOMAIN }}{{ TLDRAW_WEBSOCKET_PATH }}"
NOT_AUTHENTICATED_REDIRECT_URL: "{{ NOT_AUTHENTICATED_REDIRECT_URL }}"
4 changes: 4 additions & 0 deletions src/modules/server/api/dto/tldraw-config.response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class TldrawPublicConfigResponse {
this.TLDRAW_ASSETS_MAX_SIZE_BYTES = config.TLDRAW_ASSETS_MAX_SIZE_BYTES;
this.TLDRAW_ASSETS_ALLOWED_MIME_TYPES_LIST = config.TLDRAW_ASSETS_ALLOWED_MIME_TYPES_LIST;
this.FEATURE_TLDRAW_ENABLED = config.FEATURE_TLDRAW_ENABLED;
this.NOT_AUTHENTICATED_REDIRECT_URL = config.NOT_AUTHENTICATED_REDIRECT_URL;
}

@ApiProperty()
Expand All @@ -24,4 +25,7 @@ export class TldrawPublicConfigResponse {

@ApiProperty()
public FEATURE_TLDRAW_ENABLED!: boolean;

@ApiProperty()
public NOT_AUTHENTICATED_REDIRECT_URL: string;
}
1 change: 1 addition & 0 deletions src/modules/server/api/test/tldraw-config.api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('Tldraw-Config Api Test', () => {
TLDRAW_ASSETS_ENABLED: true,
TLDRAW_ASSETS_MAX_SIZE_BYTES: 10485760,
TLDRAW_WEBSOCKET_URL: 'ws://localhost:3399',
NOT_AUTHENTICATED_REDIRECT_URL: 'http://localhost:4000/login',
});
});
});
Expand Down
3 changes: 3 additions & 0 deletions src/modules/server/tldraw-server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ export class TldrawServerConfig {
@Transform(({ value }) => value === 'true')
@IsBoolean()
public FEATURE_TLDRAW_ENABLED!: boolean;

@IsUrl({ protocols: ['https', 'http'], require_tld: false })
public NOT_AUTHENTICATED_REDIRECT_URL!: string;
}

0 comments on commit ed87499

Please sign in to comment.