简体   繁体   English

角 - Auth0

[英]Angular - Auth0

I am trying to add Auth0 to my angular app.我正在尝试将 Auth0 添加到我的 Angular 应用程序中。

First, I followed https://auth0.com/docs/quickstart/spa/angular/01-login , but after login, Auth0 redirects me back to my callback page and it's work fine.首先,我关注了https://auth0.com/docs/quickstart/spa/angular/01-login ,但登录后,Auth0 将我重定向回我的回调页面,它工作正常。

our problem is AuthO token automatically refreshes when the token expired.我们的问题是 AuthO 令牌在令牌过期时自动刷新。

How to stop the AuthO token from automatically refreshing?如何阻止 AuthO 令牌自动刷新? We need to navigate to the login page after the token expired.令牌过期后,我们需要导航到登录页面。

AuthModule.forRoot({
      "clientId": "XXXXXXXXXXXXXXXXXXXXXXXXX",
        "domain": "XXXXXXXXXXXXXXXXXXXXXXXXX",
        "cacheLocation": "localstorage",
        "useRefreshTokens": false,
        "useRefreshTokensFallback": false
    }),

you should check the httpInterceptor and remove the call to refresh token if they have made from there您应该检查httpInterceptor并删除对刷新令牌的调用,如果它们是从那里进行的

you can check the error handling in httpInteceptor where 401 will be checked and refresh token may be called您可以检查httpInteceptor中的错误处理,其中将检查 401 并可能调用刷新令牌

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM