aristippe / pathagar

Pathagar is a simple bookserver serving OPDS feeds
GNU General Public License v2.0
1 stars 1 forks source link

Already logged in user users can visit accounts/signin #42

Open sinergatis opened 8 years ago

sinergatis commented 8 years ago

Currently, if a user is already logged in, he is allowed to visit the login url at /accounts/signin/, and the results are a bit strange: the username/password box is displayed, along with the standard header and footer for logged in users.

It might be by userena design, but perhaps some setting can be toggled somewhere on the later versions of userena to prevent this behavior? Other alternatives would be to tweak the template so the form is not displayed for logged in users, or wrap the signin view onto another one that basically redirects the user to home or similar.

aristippe commented 8 years ago

Good find. It is indeed because of userena, though the same thing might have happened with the older login place. Apparently a server redirect is recommended. Maybe it's possible to override the default userena.views.signin (or report a bug), or go back to the old sign in view and add a redirect there.

sinergatis commented 8 years ago

Yeah, mainly a matter of digging through userena docs and issues.

If nothing is found, I'd go indeed with writing a small login view that basically checks if the user is logged in: if it is, just redirect him to home; if not, redirected him (or call) userena.views.signin.

aristippe commented 8 years ago

I looked at the signin function of userena and it doesn't do anything if already logged in. I filed an issue. I'll also lookup the old login code and give it a try.

aristippe commented 8 years ago

Haven't had a chance to look at it recent though someone did comment the issue:

https://github.com/bread-and-pepper/django-userena/issues/516#issuecomment-201304151