angular - Auth0-lock 不会显示关闭按钮角度
问题描述
我一直在尝试将 auth0-lock 小部件添加到我的 Angular 应用程序中,它工作得很好,但是当涉及到 ui 自定义时,即使我添加了选项 closable: true 也不会出现关闭按钮。这是我的代码:
import {Auth0Lock} from 'auth0-lock'
constructor(private router: Router, private cookie: CookieService, private http: HttpClient){
this.lock.on("authenticated", (authResult: any) => {
this.lock.getProfile(authResult.accessToken, async (error: any, profile: any) => {
if (error) throw new Error('error');
// code
});
});
}
auth0Options = {
closable: true,
theme: {
primaryColor: '#DFA612'
},
auth: {
redirectUrl: environment.auth0.callbackURL,
responseType: 'token id_token',
audience: `https://${environment.auth0.domain}/userinfo`,
params: {
scope: 'openid profile email'
}
},
autoclose: true
};
lock = new Auth0Lock(
environment.auth0.clientId,
environment.auth0.domain,
this.auth0Options
)
login(){
this.lock.show()
}
logout(){
this.lock.logout();
//code
}
请问有什么帮助吗?先感谢您。
PS:一切正常,我唯一的问题是它无法关闭。
解决方案
样式有问题,我不得不覆盖关闭按钮 css 类,.auth0-lock-close-button
并将其设置z-index
为更高的值。
推荐阅读
- jquery - 语义 UI 嵌入:如何知道状态变化?
- selenium-webdriver - Selenium Webdriver 使用 java 自动显示浏览器
- python - Python 的输出流是线程安全的吗?
- python - cv2.fillPoly 奇怪的结果
- ruby-on-rails - ActiveModel::UnknownAttributeError(Property 的未知属性“product_id”。):
- ruby-on-rails - 在 haml 文件中渲染 rails 真正的 favicon favicon
- scipy - How to use scipy.interpolate.LinearNDInterpolator with own triangulation
- docker - docker run command fails
- php - Get Attachments REST API php
- ruby-on-rails - Rails 3 升级到 4 个资产导致 Rack::Timeout::RequestTimeoutException