Add login flows test. Fix #2.