Added logout/timeout to check if the user is still authenticated