Hint: Check the terminal for promo codes
@@ -2725,9 +2792,16 @@ function TerminalApp() {
);
}
-function PassportApp() {
- const { user, isAuthenticated } = useAuth();
- const { data: profile, isLoading } = useQuery({
+function PassportApp({ onLoginSuccess, isDesktopLocked }: { onLoginSuccess?: () => void; isDesktopLocked?: boolean }) {
+ const { user, isAuthenticated, login, signup, logout } = useAuth();
+ const [mode, setMode] = useState<'view' | 'login' | 'signup'>('view');
+ const [email, setEmail] = useState('');
+ const [password, setPassword] = useState('');
+ const [username, setUsername] = useState('');
+ const [error, setError] = useState('');
+ const [isSubmitting, setIsSubmitting] = useState(false);
+
+ const { data: profile } = useQuery({
queryKey: ['os-user-profile'],
queryFn: async () => {
const res = await fetch('/api/metrics');
@@ -2736,6 +2810,143 @@ function PassportApp() {
enabled: true,
});
+ useEffect(() => {
+ if (isAuthenticated && isDesktopLocked && onLoginSuccess) {
+ onLoginSuccess();
+ }
+ }, [isAuthenticated, isDesktopLocked, onLoginSuccess]);
+
+ useEffect(() => {
+ if (!isAuthenticated && isDesktopLocked) {
+ setMode('login');
+ }
+ }, [isAuthenticated, isDesktopLocked]);
+
+ const handleLogin = async (e: React.FormEvent) => {
+ e.preventDefault();
+ setError('');
+ setIsSubmitting(true);
+ try {
+ await login(email, password);
+ setMode('view');
+ if (onLoginSuccess) onLoginSuccess();
+ } catch (err: any) {
+ setError(err.message || 'Login failed');
+ } finally {
+ setIsSubmitting(false);
+ }
+ };
+
+ const handleSignup = async (e: React.FormEvent) => {
+ e.preventDefault();
+ setError('');
+ setIsSubmitting(true);
+ try {
+ await signup(email, password, username || undefined);
+ setMode('login');
+ setError('Account created! Please sign in.');
+ } catch (err: any) {
+ setError(err.message || 'Signup failed');
+ } finally {
+ setIsSubmitting(false);
+ }
+ };
+
+ if (mode === 'login' || mode === 'signup') {
+ return (
+
@@ -2770,6 +2981,26 @@ function PassportApp() {
)}
+
+ {!isAuthenticated ? (
+
+ ) : (
+
+ )}
+
+
Issued by Codex Certification Authority
@@ -3811,7 +4042,7 @@ function ProfilesApp() {
);
}
-function NetworkNeighborhoodApp() {
+function NetworkNeighborhoodApp({ openIframeWindow }: { openIframeWindow?: (url: string, title: string) => void }) {
const { data: founders = [], isLoading } = useQuery({
queryKey: ['network-neighborhood'],
queryFn: async () => {
@@ -3880,14 +4111,12 @@ function NetworkNeighborhoodApp() {
[{String(founders.length + idx + 1).padStart(3, '0')}]
{slot.name}
-
- Redirects to aethex.studio for payment
+ Opens enrollment form
@@ -4023,7 +4250,7 @@ function FoundryApp() {
);
}
-function DevToolsApp() {
+function DevToolsApp({ openIframeWindow }: { openIframeWindow?: (url: string, title: string) => void }) {
const tools = [
{ name: "Documentation", desc: "API reference & guides", url: "https://aethex.dev", icon: