shinken-monitoring / mod-webui

Shinken Web User Interface
GNU Affero General Public License v3.0
79 stars 71 forks source link

[2.8.1] logout not working #724

Closed ayaloulameche closed 4 years ago

ayaloulameche commented 4 years ago

Hello,

Thanks for the quick fix of the Webui ;)

I keep testing the 2.8.1 version and I have an error when I try to logout . I try with different contacts (local account or ldap account) and I get the same error every time.

Here is the screenshot : image

I'm on : OS : Centos 7.7 Shinken : 2.4.3 Webui2 : 2.8.1

Can you have a look ?

Thanks in advance.

Regards

maethor commented 4 years ago

Thank you @ayaloulameche , I will have a look next week.

Scandiskfr commented 4 years ago

For info ! Same pb for me, it's begin on Webui2 2.8.0 : OS : Centos 7.7.1908 Shinken : 2.4.3 Webui2 : 2.8.1 thx.

maethor commented 4 years ago

Hi, sorry for the delay and happy new year :)

@ayaloulameche @Scandiskfr I am sorry I cannot reproduce.

Can you activate debug mode in the webui? That would make it display the stacktrace in the error page. To do so:

Then the webui should display some details on your error.

I will try to make this process easier in the next minor version.

ayaloulameche commented 4 years ago

Hello Maethor,

Happy new year ;)

I have modifying the file /var/lib/shinken/modules/webui2/module.py and restarting the broker, and here is the error with details : image

Thank you.

mohierf commented 4 years ago

As far as I remember, I met this problem recently also...

@maethor : you should try:

app.response.set_cookie(str(app.session_cookie), cookie_value, secret=app.auth_secret, path='/')

See the str that makes the cookie a single string rather than a dict

ayaloulameche commented 4 years ago

Hello,

Just to let you know, I tested the modification suggested by Mohierf. I modify the file : /var/lib/shinken/modules/webui2/plugins/login/login.py

Line 90 : app.response.set_cookie(app.session_cookie, False, secret=app.auth_secret, path='/') by app.response.set_cookie(str(app.session_cookie), False, secret=app.auth_secret, path='/')

and Line 92 : app.response.set_cookie(app.session_cookie, '', secret=app.auth_secret, path='/') by app.response.set_cookie(str(app.session_cookie), '', secret=app.auth_secret, path='/')

And then, the logout works perfectly. Thank you.

maethor commented 4 years ago

Sorry for the delay, and thank you very much for the fix. I will publish this soon.