Skip to content

Commit f853e4b

Browse files
refactor: rename use_popup_auth to use_redirect_auth and negate logic
Signed-off-by: Patrick Chin <8509935+thepatrickchin@users.noreply.github.com>
1 parent c59a289 commit f853e4b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

components/Chat/Chat.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ export const Chat = () => {
571571
return false;
572572
}
573573

574-
const shouldUsePopup = message.content?.use_popup !== false;
574+
const shouldUsePopup = !message.content?.use_redirect;
575575
if (shouldUsePopup) {
576576
const popup = window.open(
577577
oauthUrl,
@@ -822,7 +822,7 @@ export const Chat = () => {
822822
if (oauthUrl) {
823823
// Validate URL before opening to prevent Open Redirect attacks
824824
if (isValidConsentPromptURL(oauthUrl)) {
825-
const shouldUsePopup = message?.content?.use_popup !== false;
825+
const shouldUsePopup = !message?.content?.use_redirect;
826826
if (shouldUsePopup) {
827827
if (oauthPopupCancelledRef.current) return;
828828
// Open the validated OAuth URL in a new tab

types/websocket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface SystemInteractionMessage extends WebSocketMessageBase {
4444
text?: string;
4545
timeout?: number | null;
4646
error?: string | null;
47-
use_popup?: boolean;
47+
use_redirect?: boolean;
4848
};
4949
thread_id?: string;
5050
}

0 commit comments

Comments
 (0)