aiohttp-security icon indicating copy to clipboard operation
aiohttp-security copied to clipboard

simple_example_auth.py doesn't work properly

Open viskey98 opened this issue 7 years ago • 3 comments

I tried running demo/simple_example_auth.py (without any changes). I accessed it through my web-browser, when I clicked Log_me_in it wouldn't login. I still get the same output even after clicking login several times:

Hello, I'm Jack, I'm NOT logged in.

Log me in
Log me out

Check my permissions, when i'm logged in and logged out.
Can I listen?
Can I speak?

Which also makes /listen an unauthorized page.

viskey98 avatar Jul 20 '18 02:07 viskey98

Log me in link doesn't ask for login/password but emulates user login. So everything works as expected.

Maybe a Basic Auth form with pre-defined user/pass is better, feel free to make a pull request

asvetlov avatar Sep 06 '18 10:09 asvetlov

It will if you'll change "raise" to "return" for handlers: "handler_login_jack" and "handler_login_jack"

rodkevich avatar Feb 10 '21 22:02 rodkevich

That's an unrelated issue in aiohttp 3.7, certainly not related to an issue reported over 2 years ago.

Dreamsorcerer avatar Feb 10 '21 23:02 Dreamsorcerer