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

Google OAuth2 token_expired does not re-authenticate #2763

Open
oceanusxiv opened this issue Apr 21, 2023 · 1 comment
Open

Google OAuth2 token_expired does not re-authenticate #2763

oceanusxiv opened this issue Apr 21, 2023 · 1 comment

Comments

@oceanusxiv
Copy link

oceanusxiv commented Apr 21, 2023

Describe the bug/problem
If the user's Oauth2 access token has expired, instead of prompting for the Oauth2 login again, calibre-web just outputs a

[2023-04-20 19:56:06,246] ERROR {cps.oauth_bb:360} (token_expired) 

error and refuses to login.

Clearing browser cookies will force the re-authentication behavior to happen and thus avoid this issue, but this is really cumbersome to do every time the access token expires.

To Reproduce
Steps to reproduce the behavior:

  1. Setup Google Oauth2
  2. Login with Google Oauth sucessfully
  3. Wait until access token expires in browser (should take a day or two?)
  4. Attempt to login again

Logfile

[2023-04-20 19:56:06,246] ERROR {cps.oauth_bb:360} (token_expired) 

Expected behavior
If the user access token has expired, login with Oauth should redirect to google again for re-authentication.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • Python version: 3.8
  • Calibre-Web version: 0.6.20
  • Docker container: None
  • Special Hardware: Raspberry Pi 4
  • Browser: Safari

Additional context
Add any other context about the problem here. [e.g. access via reverse proxy, database background sync, special database location]

@oceanusxiv oceanusxiv changed the title Google OAuth2 token_expired Google OAuth2 token_expired does not re-authenticate Apr 21, 2023
@rickfmn
Copy link

rickfmn commented Jul 24, 2023

I added a new branch to my fork of Calibre-Web to help fix this issue. When you get the token expired message you would click on the "clear token" button on the login form. This will clear the session and token cookies. And it should work again.

https://github.com/rickfmn/calibre-web/tree/FixExpiredToken

Let me know if you have any issues on it.

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

2 participants