【发布时间】:2020-01-23 22:40:19
【问题描述】:
我已按照本教程“https://github.com/azure-ad-b2c/samples/tree/master/policies/embedded-password-reset”进行操作。一切运作良好。但是,当我尝试添加自定义 UI 页面以设置整个更改密码向导的样式时,电子邮件验证后“继续”按钮被禁用。我也找不到在更改密码工作流程中删除更改电子邮件按钮的方法。
我所做的唯一更改是添加自定义页面来样式更改密码页面。
<ContentDefinition Id="api.localaccountpasswordreset">
<LoadUri>https://xxx.blob.core.windows.net/yyy/selfasserted.html</LoadUri>
<Metadata>
<Item Key="DisplayName">Local account change password page</Item>
</Metadata>
</ContentDefinition>
自定义html页面
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
// Remove the provided password reset link
$("#forgotPassword").remove();
// Move the new password reset button to the right position
$("#PasswordResetUsingEmailAddressExchange").detach().appendTo("label[for='password']");
// Set the style of the password reset button to look like a link
$("#PasswordResetUsingEmailAddressExchange").attr("style",
"background: none!important; color:#2872DD; border:none; padding:0!important; font-size: .75em; height: auto; width: auto; margin-left: 5px");
});
</script>
</head>
<body>
<div id="api"></div>
</body>
</html>
【问题讨论】:
-
是否有特定的错误信息被抛出?
-
您的 html 文件中可能存在一些冲突的 JavaScript 或 css。
-
@Nelles 没有 JS 错误
-
我想我注意到有一次 ready() 不会告诉您 UI 内容已加载,因为它会在加载 HTML 后添加 UI 组件。因此,您可能需要进行某种形式的等待,以等待内容实际出现。
-
嗨@Amal 请注意,Azure AD B2C 引用了特定版本的 jQuery。 You mustn't include a different version of it。否则这会导致问题。
标签: azure-ad-b2c