如何使用auth0-js传递附加信息(登录后重定向用户)

时间:2018-02-25 12:07:18

标签: javascript reactjs auth0

我想将用户重定向到登录工作流程之前的当前页面。

  1. 用户想要/ profile
  2. 页面受到保护;用户被重定向到/ login
  3. 使用重定向到/ callback
  4. 的auth0-js登录工作流程
  5. 我希望回调页面将用户重定向到/个人资料页面
  6. 是否有可能将其他信息传递给auth0-js(例如{from: '/profile'})?

    这是我在我的反应应用程序中初始化Auth0-js:

    auth0 = new auth0.WebAuth({
            domain: 'xxx.auth0.com',
            clientID: 'xxx',
            redirectUri: 'http://localhost:3000/callback',
            audience: 'https://xxx.auth0.com/userinfo',
            responseType: 'token id_token',
            scope: 'openid profile offline_access'
        });
    

    要记录用户:

    auth0.authorize();
    

    如果不在localStorage中存储信息,我找不到办法。

0 个答案:

没有答案