@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
55import  QRCode  from  "qrcode.react" ; 
66import  {  useAuth  }  from  "@/lib/auth-context" ; 
77import  {  setAuthToken ,  setAuthId  }  from  "@/lib/authUtils" ; 
8+ import  {  isMobileDevice ,  getDeepLinkUrl  }  from  "@/lib/utils/mobile-detection" ; 
89
910export  default  function  LoginPage ( )  { 
1011    const  router  =  useRouter ( ) ; 
@@ -51,11 +52,10 @@ export default function LoginPage() {
5152        eventSource . onmessage  =  ( event )  =>  { 
5253            const  data  =  JSON . parse ( event . data ) ; 
5354            if  ( data . token  &&  data . user )  { 
54-                 // Store the token and user ID using auth utilities 
5555                setAuthToken ( data . token ) ; 
5656                setAuthId ( data . user . id ) ; 
5757                // Reload to trigger auth initialization 
58-                 window . location . reload ( ) ; 
58+                 window . location . href   =   '/' ; 
5959            } 
6060        } ; 
6161
@@ -69,15 +69,15 @@ export default function LoginPage() {
6969    } ,  [ sessionId ,  login ] ) ; 
7070
7171    return  ( 
72-         < div  className = "flex flex-col items-center justify-center gap-4 mt-4 " > 
72+         < div  className = "modal-container  flex flex-col items-center justify-center gap-4 safe-area-top safe-area-bottom min-h-screen px-4 pb-safe " > 
7373            < div  className = "flex flex-col items-center text-center gap-4" > 
7474                < div  className = "flex items-center gap-2 text-2xl font-bold" > 
7575                    < img  src = "/Logo.png"  alt = "eVoting Logo"  className = "h-12"  /> 
7676                    eVoting
7777                </ div > 
7878                < p  className = "text-2xl" > Secure voting in the W3DS</ p > 
7979            </ div > 
80-             < Card  className = "flex flex-col items-center gap-1 w-1/3  p-4 pt-2" > 
80+             < Card  className = "flex flex-col items-center gap-1 w-full max-w-md  p-4 pt-2 mx-4 " > 
8181                < CardHeader  className = "text-foreground text-2xl font-black" > 
8282                    Welcome to eVoting
8383                </ CardHeader > 
@@ -97,14 +97,30 @@ export default function LoginPage() {
9797                            < div  className = "text-gray-500" > Loading QR Code...</ div > 
9898                        </ div > 
9999                    )  : qrData  ? ( 
100-                         < div  className = "p-4 bg-white rounded-lg" > 
101-                             < QRCode 
102-                                 value = { qrData } 
103-                                 size = { 200 } 
104-                                 level = "M" 
105-                                 includeMargin = { true } 
106-                             /> 
107-                         </ div > 
100+                         < > 
101+                             { isMobileDevice ( )  ? ( 
102+                                 < div  className = "flex flex-col gap-4 items-center" > 
103+                                     < a 
104+                                         href = { getDeepLinkUrl ( qrData ) } 
105+                                         className = "px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-center" 
106+                                     > 
107+                                         Login with eID Wallet
108+                                     </ a > 
109+                                     < div  className = "text-xs text-gray-500 text-center max-w-xs" > 
110+                                         Click the button to open your eID wallet app
111+                                     </ div > 
112+                                 </ div > 
113+                             )  : ( 
114+                                 < div  className = "p-4 bg-white rounded-lg" > 
115+                                     < QRCode 
116+                                         value = { qrData } 
117+                                         size = { 200 } 
118+                                         level = "M" 
119+                                         includeMargin = { true } 
120+                                     /> 
121+                                 </ div > 
122+                             ) } 
123+                         </ > 
108124                    )  : ( 
109125                        < div  className = "w-48 h-48 bg-gray-100 rounded-lg flex items-center justify-center" > 
110126                            < div  className = "text-gray-500" > QR Code not available</ div > 
0 commit comments