@absolutejs/auth 0.81.0 → 0.83.0

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.
@@ -1,3 +1,3 @@
1
1
  /** Package-owned source recipe. Host bindings are explicit: no generated user
2
2
  * database, placeholder mailer, secret value or in-memory production fallback. */
3
- export declare const credentialsIntegrationSource = "import { Elysia } from 'elysia';\nimport { createAuthContext, createCredentialsApi } from '@absolutejs/auth/server';\nimport { credentialsConfiguration } from './credentials.config';\n\nexport const credentialsApi = createCredentialsApi(credentialsConfiguration);\nexport const accountApi = new Elysia()\n .use(createAuthContext({ authSessionStore: credentialsConfiguration.authSessionStore }))\n .get('/api/account', ({ absoluteAuthStatus, status }) => {\n if (!absoluteAuthStatus.user) return status(401, { error: 'Sign in required' });\n return { user: absoluteAuthStatus.user };\n });\n// Mount both subapps on the application server. Use auth without a credentials\n// block for OAuth/sign-out to avoid duplicate credential routes.\n// Browser: treaty<typeof credentialsApi>(origin).auth.login.post({email,password})\n// Execute that directly typed call in a React Query mutationFn.\n";
3
+ export declare const credentialsIntegrationSource = "import { Elysia } from 'elysia';\nimport { createAuthContext, createCredentialsApi, createSignoutApi } from '@absolutejs/auth/server';\nimport { credentialsConfiguration } from './credentials.config';\n\nexport const credentialsApi = createCredentialsApi(credentialsConfiguration);\nexport const sessionApi = createSignoutApi({ authSessionStore: credentialsConfiguration.authSessionStore });\nexport const accountApi = new Elysia()\n .use(createAuthContext({ authSessionStore: credentialsConfiguration.authSessionStore }))\n .get('/api/account', ({ absoluteAuthStatus, status }) => {\n if (!absoluteAuthStatus.user) return status(401, { error: 'Sign in required' });\n return { user: absoluteAuthStatus.user };\n });\n// Mount credentialsApi, sessionApi and accountApi for credentials-only apps.\n// For OAuth apps use full auth without its credentials block and without a\n// duplicate sessionApi mount. sessionApi is the narrow default sign-out type.\n// Browser: treaty<typeof credentialsApi>(origin).auth.login.post({email,password})\n// Sign-out: treaty<typeof sessionApi>(origin).oauth2.signout.delete()\n// Execute directly typed calls in React Query mutationFns.\n// Elysia 2 schema routes: .post(path, { body: schema }, handler).\n";
package/dist/index.d.ts CHANGED
@@ -2404,17 +2404,17 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2404
2404
  claims?: string | undefined;
2405
2405
  resource?: string | undefined;
2406
2406
  request?: string | undefined;
2407
+ state?: string | undefined;
2408
+ response_mode?: string | undefined;
2409
+ code_challenge?: string | undefined;
2407
2410
  redirect_uri?: string | undefined;
2411
+ response_type?: string | undefined;
2408
2412
  acr_values?: string | undefined;
2409
- code_challenge?: string | undefined;
2410
2413
  code_challenge_method?: string | undefined;
2411
2414
  id_token_hint?: string | undefined;
2412
2415
  max_age?: string | undefined;
2413
2416
  prompt?: string | undefined;
2414
2417
  request_uri?: string | undefined;
2415
- response_mode?: string | undefined;
2416
- response_type?: string | undefined;
2417
- state?: string | undefined;
2418
2418
  };
2419
2419
  headers: unknown;
2420
2420
  response: {
@@ -2448,8 +2448,8 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2448
2448
  grant_type?: string | undefined;
2449
2449
  claim_token?: string | undefined;
2450
2450
  assertion?: string | undefined;
2451
- client_secret?: string | undefined;
2452
2451
  redirect_uri?: string | undefined;
2452
+ client_secret?: string | undefined;
2453
2453
  client_assertion?: string | undefined;
2454
2454
  client_assertion_type?: string | undefined;
2455
2455
  code_verifier?: string | undefined;
@@ -2486,13 +2486,13 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2486
2486
  audience?: string | undefined;
2487
2487
  claims?: string | undefined;
2488
2488
  resource?: string | undefined;
2489
- client_secret?: string | undefined;
2489
+ state?: string | undefined;
2490
+ code_challenge?: string | undefined;
2490
2491
  redirect_uri?: string | undefined;
2492
+ response_type?: string | undefined;
2493
+ client_secret?: string | undefined;
2491
2494
  acr_values?: string | undefined;
2492
- code_challenge?: string | undefined;
2493
2495
  code_challenge_method?: string | undefined;
2494
- response_type?: string | undefined;
2495
- state?: string | undefined;
2496
2496
  client_assertion?: string | undefined;
2497
2497
  client_assertion_type?: string | undefined;
2498
2498
  };
@@ -2583,9 +2583,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2583
2583
  body: {
2584
2584
  client_id?: string | undefined;
2585
2585
  scope?: string | undefined;
2586
- client_secret?: string | undefined;
2587
2586
  login_hint?: string | undefined;
2588
2587
  binding_message?: string | undefined;
2588
+ client_secret?: string | undefined;
2589
2589
  };
2590
2590
  params: {};
2591
2591
  query: unknown;
@@ -2671,8 +2671,8 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2671
2671
  params: {};
2672
2672
  query: {
2673
2673
  client_id?: string | undefined;
2674
- id_token_hint?: string | undefined;
2675
2674
  state?: string | undefined;
2675
+ id_token_hint?: string | undefined;
2676
2676
  post_logout_redirect_uri?: string | undefined;
2677
2677
  };
2678
2678
  headers: unknown;
@@ -2697,8 +2697,8 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2697
2697
  post: {
2698
2698
  body: {
2699
2699
  client_id?: string | undefined;
2700
- id_token_hint?: string | undefined;
2701
2700
  state?: string | undefined;
2701
+ id_token_hint?: string | undefined;
2702
2702
  post_logout_redirect_uri?: string | undefined;
2703
2703
  };
2704
2704
  params: {};
@@ -2727,11 +2727,11 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2727
2727
  jwks?: any;
2728
2728
  scope?: string | undefined;
2729
2729
  backchannel_logout_uri?: string | undefined;
2730
- client_name?: string | undefined;
2731
- grant_types?: string[] | undefined;
2732
2730
  jwks_uri?: string | undefined;
2733
2731
  post_logout_redirect_uris?: string[] | undefined;
2734
2732
  redirect_uris?: string[] | undefined;
2733
+ client_name?: string | undefined;
2734
+ grant_types?: string[] | undefined;
2735
2735
  };
2736
2736
  params: {};
2737
2737
  query: unknown;
@@ -2791,11 +2791,11 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
2791
2791
  jwks?: any;
2792
2792
  scope?: string | undefined;
2793
2793
  backchannel_logout_uri?: string | undefined;
2794
- client_name?: string | undefined;
2795
- grant_types?: string[] | undefined;
2796
2794
  jwks_uri?: string | undefined;
2797
2795
  post_logout_redirect_uris?: string[] | undefined;
2798
2796
  redirect_uris?: string[] | undefined;
2797
+ client_name?: string | undefined;
2798
+ grant_types?: string[] | undefined;
2799
2799
  };
2800
2800
  params: {
2801
2801
  clientId: string;
@@ -4410,3 +4410,4 @@ export { portalRoutes } from './portal/routes';
4410
4410
  export { createInMemorySetupSessionStore } from './portal/inMemorySetupSessionStore';
4411
4411
  export { createNeonSetupSessionStore, createPostgresSetupSessionStore, setupSessionsTable } from './portal/postgresSetupSessionStore';
4412
4412
  export { createCredentialsApi } from './credentials/api';
4413
+ export { createSignoutApi } from './routes/signout';
package/dist/index.js CHANGED
@@ -11870,9 +11870,18 @@ var runSignOut = async (onSignOut, args) => {
11870
11870
  return false;
11871
11871
  }
11872
11872
  };
11873
- var signout = ({
11873
+ var createSignoutApi = (configuration) => createSignoutRoute({
11874
+ ...configuration,
11875
+ onSignOut: configuration.onSignOut,
11876
+ signoutRoute: "/oauth2/signout"
11877
+ });
11878
+ var signout = (configuration) => createSignoutRoute({
11879
+ ...configuration,
11880
+ signoutRoute: configuration.signoutRoute ?? "/oauth2/signout"
11881
+ });
11882
+ var createSignoutRoute = ({
11874
11883
  authSessionStore,
11875
- signoutRoute = "/oauth2/signout",
11884
+ signoutRoute,
11876
11885
  onSignOut
11877
11886
  }) => new Elysia35().use(sessionStore()).delete(signoutRoute, {
11878
11887
  cookie: t28.Cookie({
@@ -41264,6 +41273,7 @@ export {
41264
41273
  createSecretCipher,
41265
41274
  createSetupSession,
41266
41275
  createSiemLogStream,
41276
+ createSignoutApi,
41267
41277
  createStatusList,
41268
41278
  createTamperEvidentSink,
41269
41279
  createTotpKeyUri,
@@ -41537,5 +41547,5 @@ export {
41537
41547
  writeWarrant
41538
41548
  };
41539
41549
 
41540
- //# debugId=135272E1F5245CC264756E2164756E21
41550
+ //# debugId=38CB2131C9C8A6BB64756E2164756E21
41541
41551
  //# sourceMappingURL=index.js.map