Http Interceptor in NativeScript Vue

206 Views Asked by At

I'm new to NativeScript and not that experienced with Vue so I'm having troubles working with tokens. I'm using Magento API, I can do the login and save the token locally, but I'm doing this at the login page itself, I don't know if it's the right way, maybe a service would be better but can't pull off that right too.
I need to do an interceptor so I can refresh the token or logout the user when the token is no longer valid. But I can't seem to find a tutorial way to do this and one I can understand right what I'm doing.
Anyone can explain how this works and how to do it or have found a understandable tutorial for someone inexperienced?

Many thanks in advance.

Best regards, Rui Silva

0

There are 0 best solutions below