我一直试图在我的角度应用程序中添加auth0-lock小部件,它工作得很好,但是当涉及到ui自定义时,即使我添加了可关闭的选项: 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:一切都很好,我唯一的问题是它不能关闭。
发布于 2020-04-19 19:38:43
样式有一个问题,我必须重写关闭按钮css类,即.auth0-lock-close-button,并将其z-index设置为更高的值。
https://stackoverflow.com/questions/61306555
复制相似问题