Compare commits

..

No commits in common. "817be0ab9e1bb7af66a877da77c07d4a7088a881" and "fac840a348a88a3fc244b5f6afa19c7f0b8e0d4f" have entirely different histories.

3 changed files with 12 additions and 42 deletions

View File

@ -501,10 +501,6 @@ export default function App() {
setChangePasswordError(pwdError);
return;
}
if (changeOldPassword === changeNewPassword) {
setChangePasswordError('New password cannot be the same as current password.');
return;
}
if (changeNewPassword !== changeConfirmPassword) {
setChangePasswordError('New passwords do not match.');
return;
@ -518,25 +514,12 @@ export default function App() {
}, {
headers: { 'Authorization': `Bearer ${userToken}` }
});
const userEmail = loggedInUser?.email || authEmail;
// Invalidate active session so re-authentication is required
handleLogout();
setShowProfileDrawer(false);
// Pre-fill email and set auth mode to login for seamless re-auth
setAuthEmail(userEmail);
setAuthPassword('');
setAuthMode('login');
setAuthError(null);
setChangePasswordSuccess(true);
setPasswordUpdatedPopup(true);
setChangeOldPassword('');
setChangeNewPassword('');
setChangeConfirmPassword('');
setShowPasswordChange(false);
setChangePasswordSuccess(true);
setPasswordUpdatedPopup(true);
} catch (err: any) {
console.error(err);
setChangePasswordError(err.response?.data?.detail || 'Failed to update password.');
@ -1197,11 +1180,7 @@ export default function App() {
{/* 🔐 Password Updated Success Modal */}
<PasswordUpdatedModal
isOpen={passwordUpdatedPopup}
onClose={() => {
setPasswordUpdatedPopup(false);
setAuthMode('login');
setShowAuthModal(true);
}}
onClose={() => setPasswordUpdatedPopup(false)}
/>
</div>
);

View File

@ -101,14 +101,14 @@ export const AuthModal: React.FC<AuthModalProps> = ({
{authMode === 'login'
? 'Welcome Back!'
: authMode === 'register'
? 'Create Account'
? 'Create Clinical Account'
: 'Reset Password'}
</h3>
<p className="text-xs text-slate-400 leading-relaxed font-semibold">
{authMode === 'login'
? 'Sign in to access your saved TCM modules and invoices.'
: authMode === 'register'
? 'Sign up to get started and access TCM modules.'
? 'Onboard as a clinical practitioner to access TCM modules.'
: resetStep === 'request'
? 'Enter your registered email to receive a 6-digit verification code.'
: 'Enter the 6-digit code sent to your email and your new password.'}
@ -411,7 +411,7 @@ export const AuthModal: React.FC<AuthModalProps> = ({
) : (
<>
{authMode === 'login' ? <LogIn className="h-4 w-4" /> : <UserPlus className="h-4 w-4" />}
{authMode === 'login' ? 'Sign In' : 'Create Account'}
{authMode === 'login' ? 'Sign In Session' : 'Register Clinical Profile'}
</>
)}
</button>
@ -432,7 +432,7 @@ export const AuthModal: React.FC<AuthModalProps> = ({
}}
className="text-indigo-400 hover:text-indigo-300 font-bold underline"
>
{authMode === 'login' ? 'Create an account' : 'Sign in here'}
{authMode === 'login' ? 'Create clinical account' : 'Sign in here'}
</button>
</div>
)}

View File

@ -4,18 +4,9 @@ import { CheckCircle } from 'lucide-react';
interface PasswordUpdatedModalProps {
isOpen: boolean;
onClose: () => void;
title?: string;
description?: string;
buttonText?: string;
}
export const PasswordUpdatedModal: React.FC<PasswordUpdatedModalProps> = ({
isOpen,
onClose,
title = 'Password Updated!',
description = 'Your password has been securely updated. Please log in again with your new password to continue.',
buttonText = 'Log In with New Password'
}) => {
export const PasswordUpdatedModal: React.FC<PasswordUpdatedModalProps> = ({ isOpen, onClose }) => {
if (!isOpen) return null;
return (
@ -25,16 +16,16 @@ export const PasswordUpdatedModal: React.FC<PasswordUpdatedModalProps> = ({
<CheckCircle className="h-8 w-8" />
</div>
<div className="space-y-1.5">
<h3 className="text-lg font-bold text-white">{title}</h3>
<h3 className="text-lg font-bold text-white">Password Updated!</h3>
<p className="text-xs text-slate-400 leading-relaxed font-medium">
{description}
Your password has been securely updated. You can now use your new password across the storefront and mobile application.
</p>
</div>
<button
onClick={onClose}
className="w-full py-2.5 bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs rounded-xl transition-colors shadow-lg shadow-emerald-600/20 cursor-pointer"
className="w-full py-2.5 bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs rounded-xl transition-colors shadow-lg shadow-emerald-600/20"
>
{buttonText}
Continue to Storefront
</button>
</div>
</div>