89c89,101 < if ($submitted_pw eq '') --- > > # mobile phone number check > if(exists($context->{mobile_number}) && $context->{mobile_number} eq '') { > return ($main::REJECT, "Login-Reject: No mobile number registered for user $user."); > } > > # determine if challenge has been send before. > my $firsttime = 1; > if(exists($context->{otp_password}) && $context->{otp_password} ne "rejected") { > $firsttime = 0; > } > > if ($submitted_pw eq '' || $firsttime == 1) 104,105c116,119 < return ($main::REJECT, "OTP Authentication failed. Is OTP set up properly?") < unless defined $result; --- > if(not defined $result) { > return ($main::REJECT, "OTP Authentication failed. Is OTP set up properly?") > } > # unless defined $result; 113a128,132 > # submitted password incorrect. > # reset otp_password, so another otp_password will be generated and > # new challenge will be send upon next call. > $context->{otp_password} = "rejected"; >