Auth0-lock 不会显示关闭按钮 angular
Auth0-lock won't show up close button angular
我一直在尝试将 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 class .auth0-lock-close-button
并将其 z-index
设置为更高的值。
我一直在尝试将 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 class .auth0-lock-close-button
并将其 z-index
设置为更高的值。