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

user token 過期問題 #39

Open
dyfu95 opened this issue Jan 26, 2022 · 0 comments
Open

user token 過期問題 #39

dyfu95 opened this issue Jan 26, 2022 · 0 comments
Assignees

Comments

@dyfu95
Copy link
Collaborator

dyfu95 commented Jan 26, 2022

目前為避免post /answer API時,user token 是過期的,所以目前在post /answer API前,都會先post /user API,以取得最新的user token。
好處是user token一定不會過期,但壞處不論user token有沒有過期,都會重新打一次 /user API,是不是有更好的方法?
我目前是想說,使用try...catch,如果post /answer API 時回傳401,才去重新取得user token。

@dyfu95 dyfu95 self-assigned this Jan 26, 2022
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