Permalink
Browse files

feat: allow `token` to be a nested object in the response (#45)

With this change the `token` name can be `data.token` for example.

eg response: 

```json
{
    data: {
        ...
        token: '...'
    }
}
```

I've not checked for BC, but in theory it should be fine.... right?
  • Loading branch information...
tobz-nz authored and pi0 committed Jan 26, 2018
1 parent 8a53de8 commit 80648390462da95a4f08dbb88aa99a9ee2a945b9
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/templates/auth.store.js
@@ -146,7 +146,7 @@ export default {
let data = await this.$axios.$post(endpoint, fields)
<% if (options.token.enabled) { %>
await dispatch('updateToken', data['<%= options.token.name %>'])
await dispatch('updateToken', data.<%= options.token.name %>)
<% } %>
// Fetch authenticated user

0 comments on commit 8064839

Please sign in to comment.