@@ -70,7 +70,7 @@ export default function LoginModal({ isOpen, setIsOpen, onLoginSuccess }: LoginM
7070 title : "Admin Login Successful" ,
7171 description : "Welcome, Admin!" ,
7272 } ) ;
73- setIsOpen ( false ) ;
73+ setIsOpen ( false ) ;
7474 onLoginSuccess ( {
7575 role : "admin" ,
7676 token : "dev-admin-token" ,
@@ -196,24 +196,33 @@ export default function LoginModal({ isOpen, setIsOpen, onLoginSuccess }: LoginM
196196 return ;
197197 }
198198
199+ const actionCodeSettings = {
200+ url : `${ window . location . origin } /?action=login&from=reset` ,
201+ handleCodeInApp : true ,
202+ } ;
203+
199204 try {
200- await sendPasswordResetEmail ( auth , email ) ;
205+ await sendPasswordResetEmail ( auth , email , actionCodeSettings ) ;
201206 toast ( {
202207 title : "Password Reset Email Sent" ,
203- description : "Please check your inbox for instructions to reset your password." ,
208+ description : "Please check your inbox for instructions to reset your password. You will be redirected back here. " ,
204209 } ) ;
205210 } catch ( error : any ) {
211+ let description = "Could not send password reset email. Please check the address and try again." ;
212+ if ( error . code === 'auth/user-not-found' ) {
213+ description = "No user found with this email address."
214+ }
206215 toast ( {
207216 variant : "destructive" ,
208217 title : "Failed to Send Email" ,
209- description : "Could not send password reset email. Please check the address and try again." ,
218+ description : description ,
210219 } ) ;
211220 }
212221 } ;
213222
214223 return (
215224 < Dialog open = { isOpen } onOpenChange = { setIsOpen } >
216- < DialogContent className = "sm:max-w-lg" >
225+ < DialogContent className = "sm:max-w-lg auth-modal-glow overflow-hidden " >
217226 < DialogHeader className = "text-center" >
218227 < DialogTitle > Login</ DialogTitle >
219228 < DialogDescription >
0 commit comments