anchor.diff:           process_post/2,
            process_auth_request/2,
            delete_streams_with_user_id/1,
  -         replace_access_token/2,
  +         replace_token/3,
            user_is_new/1,
            store_user/3,
            get_user_by_name/1]).
  
positive.code:     end.
  
  
  -spec replace_access_token(Username::string(), AccToken::string()) -> tuple().
  replace_access_token(Username, AccToken) ->
      case get_user_by_name(Username) of
          {error, Msg} -> {error, Msg};
          {ok, JSON}   ->
              UserJSON = lib_json:replace_field(JSON, "access_token", AccToken),
              Update   = lib_json:set_attr(doc, UserJSON),
              case api_help:update_doc(?INDEX, "user", Username, Update) of
                  {ok, NewJSON}         -> {ok, NewJSON};
  
negative.code: %% @end
  -spec put_user(ReqData::tuple(), State::string()) -> {true, tuple(), string()}.
  put_user(ReqData, State) ->
      case openidc:authenticate_request(ReqData) of
          {error, Msg} -> {{halt, 403}, wrq:set_resp_body(Msg, ReqData), State};
          {ok, Token} ->
              case api_help:is_subs(ReqData) or api_help:is_unsubs(ReqData) of
  