}
}
- if ( isset( $data->req ) ) {
- $needReq = $data->req;
- } else {
- $needReq = new PasswordAuthenticationRequest();
+ $needReq = isset( $data->req ) ? $data->req : new PasswordAuthenticationRequest();
+ if ( !$needReq->action ) {
$needReq->action = AuthManager::ACTION_CHANGE;
}
+ $needReq->required = $data->hard ? AuthenticationRequest::REQUIRED
+ : AuthenticationRequest::OPTIONAL;
$needReqs = [ $needReq ];
if ( !$data->hard ) {
$needReqs[] = new ButtonAuthenticationRequest(