Auth-module: error if token was expired

Created on 5 Mar 2018  路  7Comments  路  Source: nuxt-community/auth-module

If the token was expired then i can not do the logout because the token always is added to header in the api request. The response from the api is always 401 not 200 and reset method never execute.

This question is available on Nuxt.js community (#c64)
invalid

Most helpful comment

What is really fixed? I still don't get redirect if my backend response status == 401. I tried to set resetOnError: true but nothing seems to happen.

Just in case someone is stucked on the same problem, this is what I did as workaround for this problem:

https://gist.github.com/gnumarcelo/98b9016679ffe9136b56eea61b9e520f

ps.: You don't need to set resetOnError

All 7 comments

Can you give more information and a way to reproduce your error ?

Closed for inactivity and lack of reproduction.

Same problem happens to me. I'm use devise_jwt with RoR (waiting-for-dev/devise-jwt). When token expires I can't login again without clear all browser data.

Is there any way to make renewal automatic?

@danieldenis01 Sure. Such enhancement is planned for next releases.

What is really fixed? I still don't get redirect if my backend response status == 401. I tried to set resetOnError: true but nothing seems to happen.

Just in case someone is stucked on the same problem, this is what I did as workaround for this problem:

https://gist.github.com/gnumarcelo/98b9016679ffe9136b56eea61b9e520f

ps.: You don't need to set resetOnError

Thanks @gnumarcelo your sample code help my code when token expired occur.

Why is the issue closed? can we reopen it when we know we are working with workarounds?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuwacker picture yuwacker  路  3Comments

essamamdani picture essamamdani  路  3Comments

nilskoppelmann picture nilskoppelmann  路  3Comments

javialon26 picture javialon26  路  3Comments

weijinnx picture weijinnx  路  3Comments