@absolutejs/auth 0.80.1 → 0.81.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
@@ -48,6 +48,24 @@ var __export = (target, all) => {
48
48
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
49
49
  var __require = import.meta.require;
50
50
 
51
+ // src/credentials/integration.ts
52
+ var credentialsIntegrationSource = `import { Elysia } from 'elysia';
53
+ import { createAuthContext, createCredentialsApi } from '@absolutejs/auth/server';
54
+ import { credentialsConfiguration } from './credentials.config';
55
+
56
+ export const credentialsApi = createCredentialsApi(credentialsConfiguration);
57
+ export const accountApi = new Elysia()
58
+ .use(createAuthContext({ authSessionStore: credentialsConfiguration.authSessionStore }))
59
+ .get('/api/account', ({ absoluteAuthStatus, status }) => {
60
+ if (!absoluteAuthStatus.user) return status(401, { error: 'Sign in required' });
61
+ return { user: absoluteAuthStatus.user };
62
+ });
63
+ // Mount both subapps on the application server. Use auth without a credentials
64
+ // block for OAuth/sign-out to avoid duplicate credential routes.
65
+ // Browser: treaty<typeof credentialsApi>(origin).auth.login.post({email,password})
66
+ // Execute that directly typed call in a React Query mutationFn.
67
+ `;
68
+
51
69
  // node_modules/typebox/build/system/memory/memory.mjs
52
70
  var exports_memory = {};
53
71
  __export(exports_memory, {
@@ -8519,6 +8537,39 @@ var manifest = defineManifest()({
8519
8537
  }
8520
8538
  },
8521
8539
  tools: {
8540
+ get_credentials_integration: tool.workspace({
8541
+ annotations: { readOnlyHint: true },
8542
+ authorization: {
8543
+ approval: "never",
8544
+ audience: "admin",
8545
+ effects: ["read"],
8546
+ requiredScopes: ["auth:inspect"]
8547
+ },
8548
+ capabilities: ["read"],
8549
+ description: "Get the package-owned typed email/password API and protected account route recipe. Reuse createCredentialsApi rather than inventing request wrappers. Requires application-owned user callbacks, a durable session and credential store, and real email delivery.",
8550
+ input: exports_typebox.Object({}),
8551
+ handler: () => JSON.stringify({
8552
+ configurationModule: "credentials.config.ts",
8553
+ requiredBindings: [
8554
+ "authSessionStore",
8555
+ "credentialStore",
8556
+ "getUserByEmail",
8557
+ "onCreateCredentialUser",
8558
+ "onSendEmail"
8559
+ ],
8560
+ requiredExport: "credentialsConfiguration",
8561
+ routes: [
8562
+ "POST /auth/register",
8563
+ "POST /auth/login",
8564
+ "POST /auth/verify-email",
8565
+ "POST /auth/verify-email/request",
8566
+ "POST /auth/reset-password",
8567
+ "POST /auth/reset-password/request"
8568
+ ],
8569
+ source: credentialsIntegrationSource,
8570
+ validation: "Typecheck the generated module and run signup, login, verification, reset and protected-route tests. Never replace missing infrastructure with an in-memory production store or no-op email delivery."
8571
+ })
8572
+ }),
8522
8573
  list_sign_in_providers: tool.workspace({
8523
8574
  annotations: { readOnlyHint: true },
8524
8575
  authorization: {
@@ -8543,7 +8594,7 @@ var manifest = defineManifest()({
8543
8594
  },
8544
8595
  wiring: [
8545
8596
  {
8546
- description: "Sign in with Google, GitHub, and 60+ other services. Add email/password later from settings.",
8597
+ description: "Sign in with Google, GitHub, and 60+ other services. For email/password use get_credentials_integration and supply application-owned user, storage and email bindings.",
8547
8598
  id: "default",
8548
8599
  server: {
8549
8600
  code: [
@@ -8576,5 +8627,5 @@ export {
8576
8627
  manifest
8577
8628
  };
8578
8629
 
8579
- //# debugId=D79DDECC0863A70764756E2164756E21
8630
+ //# debugId=BDA0AF52C085B0BA64756E2164756E21
8580
8631
  //# sourceMappingURL=manifest.js.map