anchor.diff:  -include("tts.hrl").
   -record(state, {
             path = undefined,
  +          method = undefined,
             session = undefine,
             session_id = undefine,
             session_max_age = undefined,
             logged_in = false,
             header = undefined,
             qs = #{},
  -          body_qs = [],
  +          body_qs = #{},
             token = #{},
  -          op_id = undefined
  +          op_id = undefined,
  +          bad_request = false
   }).
   
   -define(COOKIE,<<"tts_session">>).
   
   init(_, Req, _Opts) ->
  -    extract_args(Req).   
  -
  +    try extract_args(Req) of
  +        {ok, Req2, State} -> {ok, Req2, State}
  +    catch 
  +        _:_ -> {ok, Req, #state{bad_request=true}}
  +    end.   
  +
  +handle(Req,#state{bad_request=true} = State) ->
  +    show_error_page(bad_request, Req, State);
   handle(Req,#state{path=ep_redirect} = State) ->
       redirect_to_auth_server(Req, State);
   handle(Req,#state{path=ep_return} = State) ->
       login_user_with_authcode(Req,State);
   handle(Req,#state{path=ep_main} = State) ->
       redirect_to_user_page_or_login(Req, State);
  -handle(Req,#state{path=ep_user} = State) ->
  +handle(Req,#state{path=ep_user, method=post} = State) ->
  +    handle_user_action(Req,State);
  +handle(Req,#state{path=ep_user, method=get} = State) ->
       show_user_page(Req, State).
       
   
  
positive.code:     Params = [{username, UserName},
                {credential_list, Credentials}],
      {ok, Body} = tts_user_dtl:render(Params), 
      show_html(Body, Req, State). 
  
  
  try_to_set_user({ok, #{id := #{ sub := Subject, iss := Issuer}} = Token}, Req, State) ->
  
negative.code:             redirect_to(auth_server, Req, State#state{op_id = OpenIdProviderId});
          _ ->
              {ok, Body} = tts_ui_login_dtl:render([{oidc_op_list,OpList}]),
              show_html_and_update_cookie(Body, Req, State)
      end.
  
  
  handle_user_action(Req, #state{body_qs=#{action := logout}, session=Session} = State) ->
      {ok, Req2}=clear_cookie_and_close_session(Session, Req),
      redirect_to(ep_main,Req2,State);
  handle_user_action(Req, State) ->
      show_user_page(Req,State).
  
  
  show_user_page(Req, #state{session=Session}=State) ->
      {ok,User} = tts_session:get_user(Session),
  