ADFS auth support

Move dialog.dismiss() to the last line of the else block, just in case.