fix(captcha): 1:1 align bind-phone and real status contracts
Add bind_phone captcha scene across schema/runtime/UI, require captcha on phone bind, return real captcha status objects instead of legacy option aliases, and harden form discovery for page-sign auth forms.
This commit is contained in:
1 parent
fa1ab52b8b
commit
7a4419d0dd
11 files changed
+210
-38
No files matched your search
@@ -96,3 +96,32 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="phone-modal" class="aksrt-modal" hidden>
|
||||
<div class="aksrt-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="phone-modal-title">
|
||||
<div class="aksrt-modal__header">
|
||||
<h3 id="phone-modal-title"><?php esc_html_e('绑定手机', 'aksrt'); ?></h3>
|
||||
<button type="button" class="aksrt-modal__close" data-modal-close="phone-modal" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>">×</button>
|
||||
</div>
|
||||
<form id="aksrt-bind-phone-form" class="aksrt-modal__body" data-aksrt-bind-phone-form>
|
||||
<div class="form-field">
|
||||
<label for="bind-phone-input"><?php esc_html_e('手机号', 'aksrt'); ?></label>
|
||||
<input type="tel" id="bind-phone-input" name="phone" data-aksrt-phone-input maxlength="11" autocomplete="tel" required placeholder="<?php esc_attr_e('请输入手机号', 'aksrt'); ?>">
|
||||
</div>
|
||||
<div class="form-field form-field--code">
|
||||
<label for="bind-phone-code"><?php esc_html_e('短信验证码', 'aksrt'); ?></label>
|
||||
<div class="input-wrap input-wrap--code">
|
||||
<input type="text" id="bind-phone-code" name="code" maxlength="8" autocomplete="one-time-code" required placeholder="<?php esc_attr_e('请输入验证码', 'aksrt'); ?>">
|
||||
<button type="button" class="btn-secondary btn-sm" data-aksrt-sms-trigger data-aksrt-sms-scene="bind_phone" data-aksrt-sms-phone="#bind-phone-input"><?php esc_html_e('获取验证码', 'aksrt'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (function_exists('aksrt_render_captcha')) : ?>
|
||||
<?php aksrt_render_captcha('bind_phone'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="aksrt-modal__actions">
|
||||
<button type="submit" class="btn-primary"><?php esc_html_e('确认绑定', 'aksrt'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +36,18 @@ defined('ABSPATH') || exit;
|
||||
<button type="button" class="btn-primary btn-sm security-trigger" data-modal="email-modal">
|
||||
<?php esc_html_e('更改', 'aksrt'); ?>
|
||||
</button>
|
||||
<div class="security-action-item">
|
||||
<div class="security-action-info">
|
||||
<span class="security-action-icon"><i class="fas fa-mobile-alt" aria-hidden="true"></i></span>
|
||||
<div class="security-action-text">
|
||||
<span class="security-action-title"><?php esc_html_e('绑定手机', 'aksrt'); ?></span>
|
||||
<span class="security-action-desc"><?php esc_html_e('绑定手机号后可使用短信验证码登录', 'aksrt'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn-primary btn-sm security-trigger" data-modal="phone-modal">
|
||||
<?php esc_html_e('绑定', 'aksrt'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user