Fixing user login with conditional roles (+test)