a demo logic implementation to login