function authenticate_user::mo_auth_build_qrcode_authentication_form in Google Authenticator / 2 Factor Authentication - 2FA 8
Same name and namespace in other branches
- 8.2 src/Form/authenticate_user.php \Drupal\miniorange_2fa\form\authenticate_user::mo_auth_build_qrcode_authentication_form()
1 call to authenticate_user::mo_auth_build_qrcode_authentication_form()
File
- src/
Form/ authenticate_user.php, line 343 - This is used to authenticate user during login.
Class
- authenticate_user
- @file This is used to authenticate user during login.
Namespace
Drupal\miniorange_2fa\formCode
function mo_auth_build_qrcode_authentication_form($form, $base_url, $challenge_response) {
$message = 'Please scan the below QR Code from miniOrange Authenticator app to authenticate yourself.';
$form['header']['#markup'] .= t('<div class="mo2f-message mo2f-message-status">' . $message . '</div>');
$form['header']['#markup'] .= '<div class="mo2f-text-center">';
$image = new FormattableMarkup('<img src="data:image/jpg;base64, ' . $challenge_response->qrCode . '"/>', [
':src' => $challenge_response->qrCode,
]);
$form['actions_qrcode'] = array(
'#markup' => $image,
);
$form['header']['#markup'] .= '</div>';
$form['txId'] = array(
'#type' => 'hidden',
'#value' => $challenge_response->txId,
);
$form['url'] = array(
'#type' => 'hidden',
'#value' => MoAuthConstants::$AUTH_STATUS_API,
);
$form['mo_message'] = $message;
return $form;
}