Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaxRefresh parameter question. #315

Open
ghost opened this issue Feb 18, 2023 · 1 comment
Open

MaxRefresh parameter question. #315

ghost opened this issue Feb 18, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 18, 2023

Hi, I have a question.
I'm not very good at English, so I'm sorry if I'm grammatically incorrect.
If there's any part of it that doesn't make sense, please let me know!
When I tried refresh for timed out token, but server reply "401 Unauthorized" status.
I thought this library can't update timed out token, but I'm found this comment in "auth_jwt.go" at line 45.

// This means that the maximum validity timespan for a token is TokenTime + MaxRefresh.

I was set "Timeout: time.Second" and "MaxRefresh: time.Hour" and retried timed out token refresh about 10 seconds later.
I'm expected server reply "200 OK" and return refreshed token, but server as usual reply "401 Unauthorized".
I do not know why it behaves this way. Can someone please tell me what it is?

@ghost ghost changed the title MaxReflesh parameter question. MaxRefresh parameter question. Feb 18, 2023
@duzhipeng
Copy link

是国人是吧?
估计你是把 /refresh_token 塞到 (authMiddleware.MiddlewareFunc()) 里了。
就是说,你去刷 token,却把刷 token 的路由放到了需要鉴权的路由组里去了,导致你请求 refresh_token ,系统要先验证原来那个token,但原来的那个不是已经过期了吗?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant