Skip to content

Commit c7fcd45

Browse files
committed
fix: relax CSP for eval and fix dialog accessibility
1 parent 2cfe452 commit c7fcd45

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta http-equiv="content-security-policy" content="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; frame-src 'self' https:; font-src 'self'; base-uri 'self'; manifest-src 'self'; connect-src 'self' blob: https: wss:; img-src 'self' data: blob: https:; media-src 'self' https:">
6+
<meta http-equiv="content-security-policy" content="default-src 'none'; script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src 'self' https:; font-src 'self'; base-uri 'self'; manifest-src 'self'; connect-src 'self' blob: https: wss:; img-src 'self' data: blob: https:; media-src 'self' https:">
77
<link rel="manifest" href="/manifest.webmanifest">
88
</head>
99
<body>

src/components/auth/LoginDialog.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, { useRef, useState, useEffect } from 'react';
55
import { Shield, Upload, AlertTriangle, UserPlus, KeyRound, Sparkles, Cloud } from 'lucide-react';
66
import { Button } from '@/components/ui/button';
77
import { Input } from '@/components/ui/input';
8-
import { Dialog, DialogContent, DialogHeader, DialogDescription } from "@/components/ui/dialog";
8+
import { Dialog, DialogContent, DialogHeader, DialogDescription, DialogTitle } from "@/components/ui/dialog";
99
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
1010
import { Alert, AlertDescription } from '@/components/ui/alert';
1111
import { useLoginActions } from '@/hooks/useLoginActions';
@@ -185,10 +185,11 @@ const LoginDialog: React.FC<LoginDialogProps> = ({ isOpen, onClose, onLogin, onS
185185
className={cn("max-w-[95vw] sm:max-w-md max-h-[90vh] max-h-[90dvh] p-0 overflow-hidden rounded-2xl overflow-y-scroll")}
186186
>
187187
<DialogHeader className={cn('px-6 pt-6 pb-1 relative')}>
188+
<DialogTitle className="sr-only">Sign In</DialogTitle>
188189

189-
<DialogDescription className="text-center">
190-
Sign up or log in to continue
191-
</DialogDescription>
190+
<DialogDescription className="text-center">
191+
Sign up or log in to continue
192+
</DialogDescription>
192193
</DialogHeader>
193194
<div className='px-6 pt-2 pb-4 space-y-4 overflow-y-auto flex-1'>
194195
{/* Prominent Sign Up Section */}
@@ -279,9 +280,8 @@ const LoginDialog: React.FC<LoginDialogProps> = ({ isOpen, onClose, onLogin, onS
279280
setNsec(e.target.value);
280281
if (errors.nsec) setErrors(prev => ({ ...prev, nsec: undefined }));
281282
}}
282-
className={`rounded-lg ${
283-
errors.nsec ? 'border-red-500 focus-visible:ring-red-500' : ''
284-
}`}
283+
className={`rounded-lg ${errors.nsec ? 'border-red-500 focus-visible:ring-red-500' : ''
284+
}`}
285285
placeholder='nsec1...'
286286
autoComplete="off"
287287
/>
@@ -345,9 +345,8 @@ const LoginDialog: React.FC<LoginDialogProps> = ({ isOpen, onClose, onLogin, onS
345345
setBunkerUri(e.target.value);
346346
if (errors.bunker) setErrors(prev => ({ ...prev, bunker: undefined }));
347347
}}
348-
className={`rounded-lg border-gray-300 dark:border-gray-700 focus-visible:ring-primary ${
349-
errors.bunker ? 'border-red-500' : ''
350-
}`}
348+
className={`rounded-lg border-gray-300 dark:border-gray-700 focus-visible:ring-primary ${errors.bunker ? 'border-red-500' : ''
349+
}`}
351350
placeholder='bunker://'
352351
autoComplete="off"
353352
/>
@@ -370,7 +369,7 @@ const LoginDialog: React.FC<LoginDialogProps> = ({ isOpen, onClose, onLogin, onS
370369
</div>
371370
</DialogContent>
372371
</Dialog>
373-
);
374-
};
372+
);
373+
};
375374

376375
export default LoginDialog;

0 commit comments

Comments
 (0)