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 that still use non-expiring offline tokens are delisted and blocked from new installs on January 1, 2027, and their GraphQL Admin API requests are rejected from April 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?