Because I am running Vue dev-tools, and it is sending messages for hot reload, I was confused. Sometimes I receive the token and most of the time I was not.
After debugging I've found adding once was not a good idea, instead I removeEventListener after receiving the token.
https://github.com/CodingGarden/entropychat.app/blob/c76399c4bd5194ff58431c0e01f36b2e9203ba06/client/src/store/modules/auth.js#L43-L45
Because I am running Vue dev-tools, and it is sending messages for hot reload, I was confused. Sometimes I receive the token and most of the time I was not.
After debugging I've found adding
once
was not a good idea, instead IremoveEventListener
after receiving the token.