Login dialog logic and ui [done]