Add support to reauthentiate

Auth cookies are only valid for a short period of time. So we need to
refetch an auth token when we are run into authentication errors.