Added a check and warning for expired authentication