[Bug]: POS Extension Session Token Bug

Hello,

I believe there is a bug with session tokens on POS UI Extensions.
If the device has gone idle, it can take multiple attempts to get the session token.

I currently attempt to get the session token, if its null I’ll back off and retry a few times which normally fixes the issue.
I know a few other develops have similar code to fix this.

3 Likes

Retries not working always and we keep getting null for specific merchants and users.

Any news here? Customers keep getting “null” and expired tokens using our UI Extensions.

1 Like

Same is happening to me. I tried both on Android and IOS on the latest version of the POS app and same issue, the getSessionToken function returns null.

I’m guessing this is related to the POS version since the code worked a few weeks ago. I’m also guessing this is only happening in dev mode since our production app don’t seem affected by this.

On my side, no matter how many times I retry it’s still null.

1 Like

Same thing here, no amount of retrying works. I have access to the session details but when i call getSessionToken it always returns null.

Hi folks - this looks like a similar issue, which had a possible solution here: SessionToken showing as null - #8 by EddyH

@Liam-Shopify The issue happens for us on production shops, when the UI Extension installed via Smart Grid / POS Add Tile.

We are facing a similar issue in production. Calling

api.session.getSessionToken()

in the POS extensions returns null, even with 10 retries in place. We do get a session token when a user with full shop permissions opens the POS extension, but once POS-only staff open the extension, we no longer get a session token. Is this intended? If so, what is the correct way to authenticate POS-only staff?

Yesterday, while testing on my phone (after not opening the app for a long time), I noticed the following:
• I opened the POS app.
• I tapped our tile and entered our internal PIN code.
• Verifying the PIN with the server failed due to an expired token.
• I tried to refresh/sync the POS data, but the app didn’t respond to my taps.
• I closed the POS app.
• Upon reopening it, I was prompted to log in.
• After logging in, I entered our tile, typed our internal PIN, and it worked successfully.

From this, I’ve learned that the POS app allows some interaction even when the login session has expired. However, it fails when accessing tiles or performing actions like data sync. This could be the root cause of the bug.

I’ve instructed our customer support team to guide merchants experiencing this issue to try logging out and back in. Hopefully, that will resolve the problem.