Skip to main content

Expiring offline access tokens explicitly disabled

Verifies React Router expiring offline-token configuration and refresh-metadata storage compatibility.

DetailValue
Check IDEXPIRING_OFFLINE_TOKEN
SeverityMedium
How it runsDeterministic scan and agent review

app/shopify.server.ts

import { shopifyApp } from "@shopify/shopify-app-react-router/server";

const shopify = shopifyApp({
// Turning this off keeps long-lived offline tokens that never
// rotate, so a leaked token stays valid until someone notices.
future: { expiringOfflineAccessTokens: false },
sessionStorage: new PrismaSessionStorage(prisma),
});

Enable expiringOfflineAccessTokens and ensure session storage persists expiry and refresh metadata.

For more detail, see Migrate to expiring offline access tokens. Public apps must use expiring offline tokens for GraphQL Admin API requests from January 1, 2027.

app/shopify.server.ts

import { shopifyApp } from "@shopify/shopify-app-react-router/server";

const shopify = shopifyApp({
future: { expiringOfflineAccessTokens: true },
sessionStorage: new PrismaSessionStorage(prisma),
});

// Session storage has to persist the refresh metadata, or the
// tokens expire with nothing to renew them.
//
// // prisma/schema.prisma
// model Session {
// expires DateTime?
// refreshToken String?
// refreshTokenExpires DateTime?
// }


Was this page helpful?