mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-05 12:16:46 +00:00
fix(dashboard): detect popup blocked during OAuth flow
Show toast warning with manual URL copy instructions when browser blocks OAuth popup window.
This commit is contained in:
@@ -215,9 +215,16 @@ export function AddAccountDialog({
|
|||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
authFlow.authUrl && window.open(authFlow.authUrl, '_blank')
|
if (!authFlow.authUrl) return;
|
||||||
}
|
const popup = window.open(authFlow.authUrl, '_blank');
|
||||||
|
if (!popup || popup.closed || typeof popup.closed === 'undefined') {
|
||||||
|
toast.warning(
|
||||||
|
'Popup blocked. Copy the URL above and open it manually in your browser.',
|
||||||
|
{ duration: 5000 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<ExternalLink className="w-3 h-3 mr-1" />
|
<ExternalLink className="w-3 h-3 mr-1" />
|
||||||
Open
|
Open
|
||||||
|
|||||||
Reference in New Issue
Block a user