laravel-xero icon indicating copy to clipboard operation
laravel-xero copied to clipboard

Disconnecting and reconnecting breaks tokens

Open craigrileyuk opened this issue 1 year ago • 2 comments

Starting with an empty xero_tokens table and going through the OAuth flow, everything works fine.

However, if you run disconnect and then reconnect later, the tokens seem to break. It's trying to use id=1 as the tenant (which doesn't exist anymore) and in the process manages to wipe out all of the token data.

Workaround is to run

Xero::disconnect();
DB::table('xero_tokens')->truncate();

to disconnect but obviously this could cause an issue for those using multiple tokens at the same time.

craigrileyuk avatar May 04 '23 10:05 craigrileyuk

I am getting the same problem. Even if you manually delete the first token, it will not work. It seems it will only work when the xero_tokens id=1

mattglover11 avatar Aug 30 '23 07:08 mattglover11

@craigrileyuk @mattglover11 can you confirm if this issue is still present? I am struggling to replicate.

tonypartridger avatar Mar 11 '24 09:03 tonypartridger