Description:
Update the authenticateUser function in the file TWS-ACP.php to add a condition that allows login only when the email is demo@gmail.com and the password is demo1234. If the credentials do not match, show an error toast with the message:
showToast(simulatedResponse.message || 'Invalid credentials. Please try again.', 'error');
Updated Function:
function authenticateUser(email, password) {
const simulatedResponse = {
success: email === 'demo@gmail.com' && password === 'demo1234',
message: email === 'demo@gmail.com' && password === 'demo1234'
? 'Login successful!'
: 'Invalid credentials. Please try again.'
};
if (simulatedResponse.success) {
showToast(simulatedResponse.message, 'success');
window.location.href = 'dashboard.php';
} else {
showToast(simulatedResponse.message, 'error');
}
}
This ensures that only the specified credentials (demo@gmail.com and demo1234) can successfully authenticate. All other attempts will result in an error toast message.
Description:
Update the
authenticateUserfunction in the fileTWS-ACP.phpto add a condition that allows login only when the email isdemo@gmail.comand the password isdemo1234. If the credentials do not match, show an error toast with the message:Updated Function:
This ensures that only the specified credentials (
demo@gmail.comanddemo1234) can successfully authenticate. All other attempts will result in an error toast message.