I have this JavaScript code, in this scenario if data.rval == 2 then it should redirect to signin page and display the message in that page only
if(data.rval == 1) {
window.location = "/offerletter/index";
Application.PageAlertBox.Show('Sucess', ['Successfully Loggedin.']);
} else if(data.rval == 2) {
window.location = "/signin";
Application.PageAlertBox.Show('info', ['OTP is Expired, New OTP has been sent on official email id, Please try again.']);
} else if(data.rval == -4) {
Application.PageAlertBox.Show('error', ['OTP is Invalid. Please Enter correct OTP.']);
} else {
Application.PageAlertBox.Show('error', [data.Message]);
}