Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-520

JS: Cumbersome API calls for login and register

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.M6
    • 1.0.0.M5
    • javascript
    • None

      I was looking at the TODO app ([1]) and noticed that with the 'auth
      module' the APP DEV has to specify 'contentType' and 'dataType' for
      the login/register API calls. Not sure, but isn't that a bit
      cumbersome?

      This is not the case for any calls on the 'pipe' API, since it is
      using the aerogear.ajax util (see [2]), which applies the above
      'contentType' and 'dataType' as default (see [3]), which is nice!

      The 'auth rest adapter', however is directly using the jQuery.ajax
      without applying the same defaults (see [4]). Perhaps we should apply
      the 'contentType' and 'dataType' default values for something like
      login or register as well?

      [1] https://github.com/aerogear/TODO/blob/picketbox/client/src/main/webapp/js/app.js#L215
      [2] https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js#L97
      [3] https://github.com/aerogear/aerogear-js/blob/master/src/utilities/aerogear.ajax.js#L13
      [4] https://github.com/aerogear/aerogear-js/blob/master/src/authentication/adapters/rest.js#L72

              kborchers Kris Borchers (Inactive)
              mwessend@redhat.com Matthias Wessendorf
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: