mattupstate/flask-security — pull request #217 by swarmer (2014-02-04 13:48:30+00:00)
Title: Make logout view do nothing if the user is already logged in

Currently if the user visits `/logout` while not being logged in, they will be redirected to `/login` and after successful authentication immediately logged out again. That doesn't make a lot of sense and can be pretty confusing. Apparently this can even happen if the user is logged in: as soon as you type `/logout` into address bar in Chrome it does a "prerender" request and when you press enter it may request `/logout` again (no idea why).

I made `logout` view simply redirect to `SECURITY_POST_LOGOUT_VIEW` if the user is already logged out.