Making authentication page pop up when authentication is needed