diff --git a/client/App.tsx b/client/App.tsx index d308b489..1547582c 100644 --- a/client/App.tsx +++ b/client/App.tsx @@ -19,6 +19,7 @@ import Index from "./pages/Index"; import Onboarding from "./pages/Onboarding"; import Dashboard from "./pages/Dashboard"; import Login from "./pages/Login"; +import Link from "./pages/Link"; import GameDevelopment from "./pages/GameDevelopment"; import MentorshipPrograms from "./pages/MentorshipPrograms"; import ResearchLabs from "./pages/ResearchLabs"; @@ -293,6 +294,7 @@ const App = () => ( element={} /> } /> + } /> } /> { + e.preventDefault(); + + if (!code.trim() || code.length !== 6) { + setError("Please enter a valid 6-character code"); + return; + } + + setLoading(true); + setError(""); + setSuccess(false); + + try { + const response = await fetch("/api/auth/verify-device-code", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ code: code.toUpperCase() }) + }); + + const data = await response.json(); + + if (!response.ok) { + throw new Error(data.message || "Failed to link device"); + } + + setSuccess(true); + setCode(""); + } catch (err: any) { + setError(err.message || "Failed to link device. Please try again."); + } finally { + setLoading(false); + } + }; + + return ( +
+ + +
+ +
+
+ Link Your Device + + Enter the 6-character code displayed in your game or app + +
+
+ + {success ? ( + + + + Device linked successfully! You can now return to your game. + + + ) : ( + <> +
+
+ + setCode(e.target.value.toUpperCase())} + maxLength={6} + className="text-center text-2xl tracking-widest font-mono bg-slate-800/50 border-purple-500/30 text-white placeholder:text-gray-600" + disabled={loading} + autoFocus + /> +
+ + {error && ( + + + + {error} + + + )} + + +
+ +
+
+

Where to find your code:

+
    +
  • VRChat: Check the in-world AeThex panel
  • +
  • RecRoom: Look for the code display board
  • +
  • Other Games: Check your authentication menu
  • +
+
+
+ + )} +
+
+
+ ); +} diff --git a/client/pages/docs/integrations/RecRoom.tsx b/client/pages/docs/integrations/RecRoom.tsx index 11761df5..391785bb 100644 --- a/client/pages/docs/integrations/RecRoom.tsx +++ b/client/pages/docs/integrations/RecRoom.tsx @@ -338,7 +338,7 @@ export async function updateScore(req, res) {

Player Links Account

- Player visits aethex.dev/dashboard?tab=link-device, enters code, + Player visits aethex.dev/link, enters code, RecRoom receives webhook with Passport ID

diff --git a/client/pages/docs/integrations/VRChat.tsx b/client/pages/docs/integrations/VRChat.tsx index 2f69b4ca..b7a20334 100644 --- a/client/pages/docs/integrations/VRChat.tsx +++ b/client/pages/docs/integrations/VRChat.tsx @@ -232,7 +232,7 @@ public class VRChatLeaderboard : UdonSharpBehaviour
  • 3. - Player visits aethex.dev/dashboard?tab=link-device and enters code + Player visits aethex.dev/link and enters code
  • 4. @@ -252,7 +252,7 @@ public void OnAuthButtonPressed() { // Display 6-digit code to player in-world authCodeText.text = $"Code: {response.code}"; - Debug.Log($"Player should visit: aethex.dev/dashboard?tab=link-device&code={response.code}"); + Debug.Log($"Player should visit: aethex.dev/link?code={response.code}"); // Poll for authentication completion StartCoroutine(PollAuthStatus(response.code));