anchor.diff:                          [SessionId, Error, Reason, StackTrace]),
               return_session_info(SessPid)
       end.
  +
  +
  +logout_rsp_session(Session) ->
  +    {ok, Type} = watts_session:get_type(Session),
  +    logout_if_rsp_session(Type, Session).
  +logout_if_rsp_session({rsp, _, _}, Session) ->
  +    logout(Session);
  +logout_if_rsp_session(_, _) ->
  +    ok.
  +
   
   
   logout(Session) ->
  
positive.code:     WMsg = "SESS~p credential request for ~p failed: ~s",
      lager:warning(WMsg, [SessionId, ServiceId, LogMsg]),
      BadCred = #{result => error, user_msg => UserMsg},
      {error, BadCred};
  handle_credential_result({error, Reason}, ServiceId, Session, _Params) ->
      {ok, SessionId} = watts_session:get_id(Session),
      ok = watts_session:clear_additional_logins(ServiceId, Session),
      {UMsg, WMsg} = credential_error_message(Reason),
      lager:warning(WMsg, [SessionId, ServiceId, Reason]),
      {error, #{result => error, user_msg => UMsg}}.
  
  
negative.code: login_with_access_token(_AccessToken, _Issuer) ->
      {error, bad_token}.
  
  
  session_for_rsp(Rsp) ->
      Provider = watts_rsp:get_provider(Rsp),
      SessType = watts_rsp:session_type(Rsp),
      {ServiceId, Params} = watts_rsp:get_service_data(Rsp),
      ProviderEnabled = not is_provider_disabled(Provider),
      NoProvider = (Provider == undefined),
      ValidProvider = NoProvider or ProviderEnabled,
      rsp_session_or_error(ValidProvider,
                              ServiceId, Params, Provider, Rsp, SessType).
  
  
  