dolanmiu / MMM-Monzo

Display Monzo to MagicMirror
MIT License
1 stars 0 forks source link

Site cannot be reached? #2

Open P3PSIE opened 6 years ago

P3PSIE commented 6 years ago

I have followed your guide to a t, but when I get to the point of using the 'token-helper' I cannot finish it. The URL it provides me works to get authorisation to log into the account, but then when I use the 'Continue to login' button in the email I receive it shows me a 'This site can't be reached' error, stating "ERR_CONNECTION_REFUSED". I have done everything I can think of and cannot get this to work. Any help would be appreciated Thanks

dolanmiu commented 6 years ago

Yes that it normal, the actual thing in the address bar is what you need, i will write a guide on it

P3PSIE commented 6 years ago

Amazing, I worked it out now thank you! Got it working perfectly and its AWESOME! Thanks for your help and time :D I have noticed a new issue though. Upon first setup everything worked perfectly with MMM-Monzo. However, it now just shows "Card Amount" and "Spent Today" texts but nothing else (see screenshot). I have checked the log and its saying its a 'Bad refresh token' so it seems the refresh token is expiring very quickly? I dont know how this is happening but it needs a new token every hour or something. screenshot

dolanmiu commented 6 years ago

I have made it in such a way such that it gets a new refresh token every so often to combat this issue

Interesting, I will have a look into it

This is the code if you are interested:

https://github.com/dolanmiu/MMM-Monzo/blob/master/src/main/token-manager.ts#L17

At the moment, it fetches a new refresh token every 6 hours, which is maybe too long do you think?

Odd because 6 hours works for me

dolanmiu commented 6 years ago

I have just made the token fetching to half an hour, try that

It may work now