10001 refactoring code in AuthDialog