Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs Auth0托管页面启动注册选项卡_Reactjs_Authentication_Auth0 - Fatal编程技术网

Reactjs 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( {

我正在使用Auth0 js包v9.1将React应用程序连接到托管页面,该页面内部使用Auth0Lock自定义用户注册参数

我想做的是有一个链接到登录标签,和一个单独的按钮直接连接到注册标签。这种控制可能吗

我有一个AuthService包装器类,当前我正在使用它来启动Auth0锁客户端

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

这是可能的,但不是很明显。以下是如何: