anchor.diff:  -export([handle/1]).
   -include("tts.hrl").
   
  -handle(#{path := ep_main, logged_in := true} = ReqMap) ->
  -    redirect_to(user_page, ReqMap);
  -handle(#{path := ep_user, method := post, logged_in := true} = ReqMap) ->
  +handle(#{method := post, logged_in := true} = ReqMap) ->
       handle_user_action(ReqMap);
  -handle(#{path := ep_user, method := get, logged_in := true,
  -         session := Session}) ->
  +handle(#{method := get, logged_in := true, session := Session}) ->
       show_user_page(Session, false, [], false);
  -handle(#{path := ep_main} = ReqMap) ->
  -    show_select_page(ReqMap);
  -handle( ReqMap) ->
  -    redirect_to(ep_main, ReqMap).
  -
  -
  -show_select_page(ReqMap) ->
  -    {ok, OpList} = tts:get_openid_provider_list(),
  -    Error = maps:get(error, ReqMap, undefined),
  -    {ok, Version} = application:get_key(tts, vsn),
  -    {ok, Body} = tts_main_dtl:render([{ep_redirect, ?CONFIG(ep_redirect)},
  -                                      {oidc_op_list, OpList},
  -                                      {version, Version},
  -                                      {error, Error},
  -                                      {configured, true}]),
  -    Cookie = maps:get(cookie, ReqMap, update),
  -    #{body => Body, status => 200, cookie => Cookie}.
  -
  +handle(ReqMap) ->
  +    show_select_page(ReqMap).
   
   handle_user_action(#{body_qs:=#{action := request}} = ReqMap) ->
       request_credential(ReqMap);
  
positive.code: request_credential(#{session := Session,
                       body_qs:= #{ service_id:=ServiceId}}) ->
      Iface = <<"web interface">>,
      case  tts:request_credential_for(ServiceId, Session, [], Iface) of
          {ok, Credential, Log} ->
              show_user_page(Session, Credential, Log, false);
          {error, _Reason, Log} ->
              ErrMsg = <<"failed to request credential">>,
              show_user_page(Session, false, Log, ErrMsg)
      end;
  request_credential(#{session := Session}) ->
      Error = <<"Credential Request failed">>,
      show_user_page(Session, false, [], Error).
  
negative.code:     {ok, Body} = tts_main_dtl:render(Params),
      #{body => Body, status => 200, cookie => update}.
  
  show_select_page(ReqMap) ->
      {ok, OpList} = tts:get_openid_provider_list(),
      Error = maps:get(error, ReqMap, undefined),
      {ok, Version} = application:get_key(tts, vsn),
      {ok, Body} = tts_main_dtl:render([{ep_redirect, ?CONFIG(ep_oidc)},
                                        {oidc_op_list, OpList},
                                        {version, Version},
                                        {error, Error},
                                        {configured, true}]),
      Cookie = maps:get(cookie, ReqMap, update),
      #{body => Body, status => 200, cookie => Cookie}.
  
  redirect_to(user_page, _ReqMap) ->
      UserPath = ?CONFIG(ep_user),
      create_redirection(UserPath);
  