G
G
gibsonen2019-03-28 12:54:43
Java
gibsonen, 2019-03-28 12:54:43

How to properly store a token and why do we need a presenter?

I use dagger2 and MOXY(mvp). The dagger has a module in which the retrofit builder is created and http requests are made in it. In the presenter, I catch callbacks. And one of the callbacks receives the accesstoken. I can’t write an interceptor, because I have several services for sending http requests with different base urls. What to do in my case? Where to store the token?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tiberal, 2019-03-28
@Tiberal

Write an object that will store the token and check its validity (if possible). Place it in the dagger network module. Refresh token by refresh/login. Inject where needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question