ducky/web

Paddy 2015-05-31 Parent:b9d0efb44eaa Child:ef386518fa14

7:e6da0d35a533 Go to Latest

ducky/web/src/config.js

Add error handling messages, clear server errors on validation. Add missing messages for error conditions that our server can return. Clear our server error messages when client-side validation occurs, so you aren't confusingly left with errors after you change the input that caused them. Ideally, this behaviour would be limited to just the errors that were caused by the updated field, but clearing all of them seems to be the more user-friendly behaviour than just leaving them. Baby steps. Fix a bug in our handling of error messages--ampersand-sync is kind of inconsistent, and parses our successful responses as JSON, but neglects to parse the error responses as JSON. So we need to manually parse our errors from JSON before we can work with them. We also added a handler for invalid_client error messages, which don't match our error objects (thanks OAuth2 spec!), so we translate it to one of our error objects and then add it to the server errors to be displayed.

History
1 export default {
2 'urlBase': 'http://slightly.local:8080',
3 'clientID': '677e13ff-18ff-4529-96ae-2d24496ef49f',
4 'clientSecret': '6406a8dc7216e6f248908905459b21617468be0aa1a207173a9bfb9669bb3db3',
5 'stripeKey': 'pk_test_w2jN5rCKL9t9CcMPta2SsX7J',
6 }