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

[#2099] fix(web): redirect to login page if token has expired #2312

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

ch3yne
Copy link
Contributor

@ch3yne ch3yne commented Feb 22, 2024

What changes were proposed in this pull request?

Remove refresh token and redirect to login page if token has expired.

Why are the changes needed?

Fix: #2099

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

N/A

@ch3yne ch3yne self-assigned this Feb 22, 2024
@qqqttt123 qqqttt123 added need backport Issues that need to backport to another branch branch-0.4 labels Feb 22, 2024
@jerryshao jerryshao closed this Feb 23, 2024
@jerryshao jerryshao reopened this Feb 23, 2024
@jerryshao
Copy link
Contributor

There's another solution. if the token is expired and returns 401, we can redirect to the login page to ask users to re-login. WDYT @qqqttt123 ?

@qqqttt123
Copy link
Contributor

There's another solution. if the token is expired and returns 401, we can redirect to the login page to ask users to re-login. WDYT @qqqttt123 ?

This may affect the experience of users.

@jerryshao
Copy link
Contributor

There's another solution. if the token is expired and returns 401, we can redirect to the login page to ask users to re-login. WDYT @qqqttt123 ?

This may affect the experience of users.

Yeah, but it is a common way as far as I know. We cannot renew the token forever, it is not safe.

@qqqttt123
Copy link
Contributor

There's another solution. if the token is expired and returns 401, we can redirect to the login page to ask users to re-login. WDYT @qqqttt123 ?

This may affect the experience of users.

Yeah, but it is a common way as far as I know. We cannot renew the token forever, it is not safe.

OK, it's also acceptable.

@jerryshao
Copy link
Contributor

@ch3yne Can you please update the codes to the logic we mentioned above?

@ch3yne
Copy link
Contributor Author

ch3yne commented Feb 27, 2024

@ch3yne Can you please update the codes to the logic we mentioned above?

Done.

@xunliu
Copy link
Member

xunliu commented Feb 28, 2024

@LauraXia123 Please help review this PR, thanks!

@xunliu xunliu requested a review from LauraXia123 February 28, 2024 09:25

Router().push('/ui/login')
window.location.href = '/ui/login'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image For Server Components, use the redirect function instead.

@jerryshao
Copy link
Contributor

@ch3yne would you please update the PR title and description? The current change is not about refreshing the token any more.

@ch3yne ch3yne changed the title [#2099] fix(web): fix oauth mode refresh token [#2099] fix(web): redirect to login page if token has expired Feb 29, 2024
@ch3yne
Copy link
Contributor Author

ch3yne commented Feb 29, 2024

@ch3yne would you please update the PR title and description? The current change is not about refreshing the token any more.

Done

@jerryshao jerryshao merged commit 4ace788 into apache:main Feb 29, 2024
12 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 29, 2024
### What changes were proposed in this pull request?

Remove refresh token and redirect to login page if token has expired.

### Why are the changes needed?

Fix: #2099 

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-0.4 need backport Issues that need to backport to another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report]OAuth mode, authentication expired after a few minutes.
5 participants