Reactjs Auth0托管页面启动注册选项卡
我正在使用Auth0 js包v9.1将React应用程序连接到托管页面,该页面内部使用Auth0Lock自定义用户注册参数 我想做的是有一个链接到登录标签,和一个单独的按钮直接连接到注册标签。这种控制可能吗 我有一个AuthService包装器类,当前我正在使用它来启动Auth0锁客户端Reactjs Auth0托管页面启动注册选项卡,reactjs,authentication,auth0,Reactjs,Authentication,Auth0,我正在使用Auth0 js包v9.1将React应用程序连接到托管页面,该页面内部使用Auth0Lock自定义用户注册参数 我想做的是有一个链接到登录标签,和一个单独的按钮直接连接到注册标签。这种控制可能吗 我有一个AuthService包装器类,当前我正在使用它来启动Auth0锁客户端 export class AuthService() { constructor() { this.auth0 = new auth0.WebAuth( {
export class AuthService() {
constructor() {
this.auth0 = new auth0.WebAuth(
{
domain: AUTH0_DOMAIN,
clientID: AUTH0_CLIENT_ID,
redirectUri: AUTH0_REDIRECT_URL,
audience: AUTH0_AUDIENCE_URL,
responseType: 'token id_token',
scope: 'openid profile email'
}
)
}
isAuthenticated() {
// Check whether the session has past the
// access token's expiry time
return ( ! this.isSessionExpired() )
}
// display the Auth0 lock modal and allow the user to log in
login() {
this.auth0.authorize()
}
...
}
export default new AuthService
我想要的是一个直接链接到注册选项卡的方法,这样我就可以从specialize组件调用它
....
signup() {
this.auth0.authorize('signup')
- or alternatively -
this.auth0.signup()
}
....
这样的事情可能吗?我将如何直接链接到“注册”选项卡
Thx这是可能的,但不是很明显。以下是如何: