Revert "Improve login handling using hooks"

This reverts commit f3a22cb0e0edbe15f49b0e877fe8e1d67843db74.