log in/out flow, fixes