@absolutejs/auth 0.80.1 → 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/CHANGELOG.md +20 -0
- package/changelog.json +40 -0
- package/dist/credentials/api.d.ts +214 -0
- package/dist/credentials/emailVerification.d.ts +189 -1
- package/dist/credentials/integration.d.ts +3 -0
- package/dist/credentials/login.d.ts +208 -1
- package/dist/credentials/passwordReset.d.ts +197 -1
- package/dist/credentials/register.d.ts +198 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +76 -34
- package/dist/index.js.map +11 -10
- package/dist/manifest.js +57 -2
- package/dist/manifest.js.map +5 -4
- package/dist/manifest.json +25 -1
- package/dist/routes/signout.d.ts +192 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +76 -34
- package/dist/server.js.map +11 -10
- package/docs/PERSISTENT-CREDENTIALS.md +44 -1
- package/package.json +4 -3
package/dist/manifest.js
CHANGED
|
@@ -48,6 +48,28 @@ 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, createSignoutApi } from '@absolutejs/auth/server';
|
|
54
|
+
import { credentialsConfiguration } from './credentials.config';
|
|
55
|
+
|
|
56
|
+
export const credentialsApi = createCredentialsApi(credentialsConfiguration);
|
|
57
|
+
export const sessionApi = createSignoutApi({ authSessionStore: credentialsConfiguration.authSessionStore });
|
|
58
|
+
export const accountApi = new Elysia()
|
|
59
|
+
.use(createAuthContext({ authSessionStore: credentialsConfiguration.authSessionStore }))
|
|
60
|
+
.get('/api/account', ({ absoluteAuthStatus, status }) => {
|
|
61
|
+
if (!absoluteAuthStatus.user) return status(401, { error: 'Sign in required' });
|
|
62
|
+
return { user: absoluteAuthStatus.user };
|
|
63
|
+
});
|
|
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.
|
|
67
|
+
// Browser: treaty<typeof credentialsApi>(origin).auth.login.post({email,password})
|
|
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).
|
|
71
|
+
`;
|
|
72
|
+
|
|
51
73
|
// node_modules/typebox/build/system/memory/memory.mjs
|
|
52
74
|
var exports_memory = {};
|
|
53
75
|
__export(exports_memory, {
|
|
@@ -8519,6 +8541,39 @@ var manifest = defineManifest()({
|
|
|
8519
8541
|
}
|
|
8520
8542
|
},
|
|
8521
8543
|
tools: {
|
|
8544
|
+
get_credentials_integration: tool.workspace({
|
|
8545
|
+
annotations: { readOnlyHint: true },
|
|
8546
|
+
authorization: {
|
|
8547
|
+
approval: "never",
|
|
8548
|
+
audience: "admin",
|
|
8549
|
+
effects: ["read"],
|
|
8550
|
+
requiredScopes: ["auth:inspect"]
|
|
8551
|
+
},
|
|
8552
|
+
capabilities: ["read"],
|
|
8553
|
+
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.",
|
|
8554
|
+
input: exports_typebox.Object({}),
|
|
8555
|
+
handler: () => JSON.stringify({
|
|
8556
|
+
configurationModule: "credentials.config.ts",
|
|
8557
|
+
requiredBindings: [
|
|
8558
|
+
"authSessionStore",
|
|
8559
|
+
"credentialStore",
|
|
8560
|
+
"getUserByEmail",
|
|
8561
|
+
"onCreateCredentialUser",
|
|
8562
|
+
"onSendEmail"
|
|
8563
|
+
],
|
|
8564
|
+
requiredExport: "credentialsConfiguration",
|
|
8565
|
+
routes: [
|
|
8566
|
+
"POST /auth/register",
|
|
8567
|
+
"POST /auth/login",
|
|
8568
|
+
"POST /auth/verify-email",
|
|
8569
|
+
"POST /auth/verify-email/request",
|
|
8570
|
+
"POST /auth/reset-password",
|
|
8571
|
+
"POST /auth/reset-password/request"
|
|
8572
|
+
],
|
|
8573
|
+
source: credentialsIntegrationSource,
|
|
8574
|
+
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."
|
|
8575
|
+
})
|
|
8576
|
+
}),
|
|
8522
8577
|
list_sign_in_providers: tool.workspace({
|
|
8523
8578
|
annotations: { readOnlyHint: true },
|
|
8524
8579
|
authorization: {
|
|
@@ -8543,7 +8598,7 @@ var manifest = defineManifest()({
|
|
|
8543
8598
|
},
|
|
8544
8599
|
wiring: [
|
|
8545
8600
|
{
|
|
8546
|
-
description: "Sign in with Google, GitHub, and 60+ other services.
|
|
8601
|
+
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
8602
|
id: "default",
|
|
8548
8603
|
server: {
|
|
8549
8604
|
code: [
|
|
@@ -8576,5 +8631,5 @@ export {
|
|
|
8576
8631
|
manifest
|
|
8577
8632
|
};
|
|
8578
8633
|
|
|
8579
|
-
//# debugId=
|
|
8634
|
+
//# debugId=E30FD38FB40CAD6A64756E2164756E21
|
|
8580
8635
|
//# sourceMappingURL=manifest.js.map
|