Login and logout does not work for Calibre-web

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.1.26
How are you able to access your server: The webadmin
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: No

Describe your issue

I have had this issue woth other apps, but for now this issue occurs when I want to log in or out of Calibre-web. There are two situations which I suppose are related to the same issue.

  1. When I am logged in as admin and want to log out, I am refered to sub.domain.tld/yunohost/sso/login with a ‘Yunohost 404 Page not found: //yunohost/sso/?action=logout’ message. And I am still logged in.

  2. When I acces the sub-domain on which calibre-web is installed, I am refered to the yunohost ddo login page, but with and added long string of character, i.e. ‘https://gnubahn.dk/yunohost/sso/login/?r=aHR0(long string of characters)Lw==’

Hence, I cannot log either out or in.
(I can login through the yunohost webadmin and open the application form there).

I wonder if I have done something wrong?

Share relevant logs or error messages

None

Hi @jacobb
This is more or less directly related to the patch :

On this line, request.host_url returns the current Calibre address (mydomain.tld/calibre/ — with the trailing slash) and adds /yunohost/sso/?action=logout, resulting in two slashes.

I have changed it in /var/www/calibreweb/cps/web.py line 1471 in /logout route.
(sudo nano /var/www/calibreweb/cps/web.py

            return redirect(request.host_url + 'yunohost/sso/?action=logout')

and then

sudo systemctl restart calibreweb

Now it works as expected.
@Krakinou peux-tu le confirmer ?

1 Like

That did it. Thanks a lot.

Is there a way to mark this as solved?

A PR is welcome :wink:

I opened an issue on github. :wink:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.