Skip to main content

Function: createAuthCodeStore()

createAuthCodeStore(__namedParameters): AuthCodeStore

Defined in: packages/auth-postgresdb/src/stores/createAuthCodeStore.ts:16

Creates an AuthCodeStore backed by the oauth_auth_codes table, storing codes by SHA-256 hash.

The engine hands the store the plaintext code on every call and never compares the returned code against anything — it reads only clientId, redirectUri, codeChallenge, scopes, subject, and expiresAt. So the adapter hashes to find the row and echoes the presented value back, and a database dump yields no replayable codes.

Parameters

ParameterTypeDescription
__namedParameters{ model: typeof OAuthAuthCode; }-
__namedParameters.modeltypeof OAuthAuthCodeThe OAuthAuthCode model class, taken from the app's db handle.

Returns

AuthCodeStore