implement the function of “dismiss then login”