0👍
In your action you need to take in state
in the destructured parameters like this: { commit, dispatch, state }
then you will be able to access your state
and log state.token
.
If it’s still null
after that point then you should debug it to ensure that you’re setting it correctly in the mutation itself.
Source:stackexchange.com