@absolutejs/auth 0.81.0 → 0.82.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.
package/dist/manifest.js CHANGED
@@ -50,20 +50,24 @@ var __require = import.meta.require;
50
50
 
51
51
  // src/credentials/integration.ts
52
52
  var credentialsIntegrationSource = `import { Elysia } from 'elysia';
53
- import { createAuthContext, createCredentialsApi } from '@absolutejs/auth/server';
53
+ import { createAuthContext, createCredentialsApi, createSignoutApi } from '@absolutejs/auth/server';
54
54
  import { credentialsConfiguration } from './credentials.config';
55
55
 
56
56
  export const credentialsApi = createCredentialsApi(credentialsConfiguration);
57
+ export const sessionApi = createSignoutApi({ authSessionStore: credentialsConfiguration.authSessionStore });
57
58
  export const accountApi = new Elysia()
58
59
  .use(createAuthContext({ authSessionStore: credentialsConfiguration.authSessionStore }))
59
60
  .get('/api/account', ({ absoluteAuthStatus, status }) => {
60
61
  if (!absoluteAuthStatus.user) return status(401, { error: 'Sign in required' });
61
62
  return { user: absoluteAuthStatus.user };
62
63
  });
63
- // Mount both subapps on the application server. Use auth without a credentials
64
- // block for OAuth/sign-out to avoid duplicate credential routes.
64
+ // Mount credentialsApi, sessionApi and accountApi for credentials-only apps.
65
+ // For OAuth apps use full auth without its credentials block and without a
66
+ // duplicate sessionApi mount. sessionApi is the narrow default sign-out type.
65
67
  // Browser: treaty<typeof credentialsApi>(origin).auth.login.post({email,password})
66
- // Execute that directly typed call in a React Query mutationFn.
68
+ // Sign-out: treaty<typeof sessionApi>(origin).oauth2.signout.delete()
69
+ // Execute directly typed calls in React Query mutationFns.
70
+ // Elysia 2 schema routes: .post(path, { body: schema }, handler).
67
71
  `;
68
72
 
69
73
  // node_modules/typebox/build/system/memory/memory.mjs
@@ -8627,5 +8631,5 @@ export {
8627
8631
  manifest
8628
8632
  };
8629
8633
 
8630
- //# debugId=BDA0AF52C085B0BA64756E2164756E21
8634
+ //# debugId=E30FD38FB40CAD6A64756E2164756E21
8631
8635
  //# sourceMappingURL=manifest.js.map