Invalid user authorisation after a period

Got it running, it was a typo in the refresh token method. Thanks @BarryCarlyon