Skip to content

Commit

Permalink
feat: allow token to be a nested object in the response (#45)
Browse files Browse the repository at this point in the history
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 8064839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/templates/auth.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8064839

Please sign in to comment.