@absolutejs/auth 0.56.5 → 0.56.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,6 +90,13 @@ export type OidcProviderConfig<UserType> = {
90
90
  onClientRegistration?: OnClientRegistration;
91
91
  /** Fires after RFC 7591 registration has been persisted and has a generated client id. */
92
92
  onClientRegistered?: OnClientRegistered;
93
+ /** Fires after an authenticated user authorizes an OAuth authorization-code
94
+ * request and the final granted scopes are known, before the code is issued. */
95
+ onAuthorizationCodeApproved?: (context: {
96
+ clientId: string;
97
+ scopes: string[];
98
+ userSub: string;
99
+ }) => void | Promise<void>;
93
100
  /** Fires after the authenticated user approves an RFC 8628 device request. */
94
101
  onDeviceAuthorizationApproved?: (context: {
95
102
  clientId: string;
@@ -8,4 +8,4 @@
8
8
  export type { OidcProviderConfig } from './config';
9
9
  export { generateSigningKey, jwkThumbprint, signJwt, toPublicJwk, verifyJwt, type SigningKey } from './keys';
10
10
  export { createNeonAuthorizationCodeStore, createNeonClientAssertionJtiStore, createNeonClientRegistrationTokenStore, createNeonDeviceAuthorizationStore, createNeonInitialAccessTokenStore, createNeonOAuthClientStore, createNeonOidcRefreshTokenStore, createPostgresAuthorizationCodeStore, createPostgresClientAssertionJtiStore, createPostgresClientRegistrationTokenStore, createPostgresDeviceAuthorizationStore, createPostgresInitialAccessTokenStore, createPostgresOAuthClientStore, createPostgresOidcRefreshTokenStore } from './postgresStores';
11
- export type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore } from './types';
11
+ export type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, OAuthClient, OAuthClientStore, OidcRefreshTokenConnection, OidcRefreshTokenStore } from './types';
@@ -11352,6 +11352,13 @@ var createPostgresOidcRefreshTokenStore = (db) => ({
11352
11352
  const rows = await db.selectDistinct({ client_id: oauthRefreshTokensTable.client_id }).from(oauthRefreshTokensTable).where(and(eq(oauthRefreshTokensTable.user_id, userId), gt(oauthRefreshTokensTable.expires_at_ms, Date.now())));
11353
11353
  return rows.map((row) => row.client_id);
11354
11354
  },
11355
+ listConnections: async () => {
11356
+ const rows = await db.selectDistinct({
11357
+ clientId: oauthRefreshTokensTable.client_id,
11358
+ userId: oauthRefreshTokensTable.user_id
11359
+ }).from(oauthRefreshTokensTable).where(gt(oauthRefreshTokensTable.expires_at_ms, Date.now()));
11360
+ return rows;
11361
+ },
11355
11362
  saveToken: async (token) => {
11356
11363
  await db.insert(oauthRefreshTokensTable).values(toRefreshValues(token));
11357
11364
  }
@@ -11447,5 +11454,5 @@ export {
11447
11454
  createNeonAuthorizationCodeStore
11448
11455
  };
11449
11456
 
11450
- //# debugId=6012AEB9DD7CDF8264756E2164756E21
11457
+ //# debugId=7E900DCFB0BEE85764756E2164756E21
11451
11458
  //# sourceMappingURL=index.js.map