{"action":"opened","issue":{"url":"https://api.github.com/repos/incuna/angular-user-management/issues/28","repository_url":"https://api.github.com/repos/incuna/angular-user-management","labels_url":"https://api.github.com/repos/incuna/angular-user-management/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/incuna/angular-user-management/issues/28/comments","events_url":"https://api.github.com/repos/incuna/angular-user-management/issues/28/events","html_url":"https://github.com/incuna/angular-user-management/issues/28","id":232900750,"number":28,"title":"TypeError when api doesn't respond to OPTIONS request with actions property","user":{"login":"henrahmagix","id":1429026,"avatar_url":"https://avatars0.githubusercontent.com/u/1429026?v=3","gravatar_id":"","url":"https://api.github.com/users/henrahmagix","html_url":"https://github.com/henrahmagix","followers_url":"https://api.github.com/users/henrahmagix/followers","following_url":"https://api.github.com/users/henrahmagix/following{/other_user}","gists_url":"https://api.github.com/users/henrahmagix/gists{/gist_id}","starred_url":"https://api.github.com/users/henrahmagix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrahmagix/subscriptions","organizations_url":"https://api.github.com/users/henrahmagix/orgs","repos_url":"https://api.github.com/users/henrahmagix/repos","events_url":"https://api.github.com/users/henrahmagix/events{/privacy}","received_events_url":"https://api.github.com/users/henrahmagix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-01T14:36:20Z","updated_at":"2017-06-01T14:36:20Z","closed_at":null,"body":"In the password and profile directives, the user's fields are fetched from an OPTIONS request.\r\n- https://github.com/incuna/angular-user-management/blob/ff7410a4a3805b8bbdf9433b989650520059a928/src/password/scripts/directives.js#L91\r\n- https://github.com/incuna/angular-user-management/blob/ff7410a4a3805b8bbdf9433b989650520059a928/src/profile/scripts/directives.js#L24\r\n\r\nIf an api using this library doesn't respond to the request with data like below, a TypeError is thrown. A simple fix is to not try to access `actions.PUT` when `actions` is undefined.\r\n```js\r\n{\r\n    \"data\": {\r\n        \"actions\": {\r\n            \"PUT\": /* user fields */\r\n        }\r\n        ...\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"henrahmagix"}}