IdentityBase

db · /index·type

Document shape for an OAuth provider link attached to a user. Stores the provider name, the provider-scoped identity ID, optional token fields, and the token expiry date. Lives as an element of the embedded users.identities[] array — the standalone NextAuth-era identities table was dropped after the Clerk auth migration; the per-user embedded list is the surviving home for a user's OAuth provider links.

Definition

@nordcom/commerce-db
type IdentityBase = BaseDocument & { accessToken: string; expiresAt: Date; identity: string; provider: string; refreshToken: string; scope: string };

BaseDocument & { accessToken: string; expiresAt: Date; identity: string; provider: string; refreshToken: string; scope: string }

Example

import type { IdentityBase } from '@nordcom/commerce-db';
function isExpired(identity: IdentityBase): boolean {
    return identity.expiresAt != null && identity.expiresAt < new Date();
}

FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme

Metadata@nordcom/commerce-db@0.1.0Open in GitHub ↗

On this page