File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 33import { useState } from 'react' ;
44import Link from 'next/link' ;
55import { useRouter , useSearchParams } from 'next/navigation' ;
6- // Dynamic import to prevent SSR/hydration crashes
7- const startAuthentication = async ( opts : any ) => {
8- const { startAuthentication : fn } = await import ( '@simplewebauthn/browser' ) ;
9- return fn ( opts ) ;
10- } ;
116
127export default function LoginForm ( ) {
138 const router = useRouter ( ) ;
@@ -166,6 +161,7 @@ export default function LoginForm() {
166161 }
167162
168163 // 2. Browser WebAuthn prompt
164+ const { startAuthentication } = await import ( '@simplewebauthn/browser' ) ;
169165 const credential = await startAuthentication ( { optionsJSON : optData . options } ) ;
170166
171167 // 3. Verify with server
Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ import { useState, useEffect } from 'react';
44import { useRouter } from 'next/navigation' ;
55import Link from 'next/link' ;
66import { authFetch } from '@/lib/auth/client' ;
7- // Dynamic import to prevent SSR/hydration crashes
8- const startRegistration = async ( opts : any ) => {
9- const { startRegistration : fn } = await import ( '@simplewebauthn/browser' ) ;
10- return fn ( opts ) ;
11- } ;
7+
128
139interface Passkey {
1410 id : string ;
@@ -70,6 +66,7 @@ export default function SecuritySettingsPage() {
7066 }
7167
7268 // 2. Start WebAuthn registration (browser prompt)
69+ const { startRegistration } = await import ( '@simplewebauthn/browser' ) ;
7370 const credential = await startRegistration ( { optionsJSON : optResult . data . options } ) ;
7471
7572 // 3. Verify with server
You can’t perform that action at this time.
0 commit comments