@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/CHANGELOG.md +6 -0
- package/changelog.json +15 -2
- package/dist/credentials/integration.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -3
- package/dist/index.js.map +4 -4
- package/dist/manifest.js +9 -5
- package/dist/manifest.js.map +3 -3
- package/dist/routes/signout.d.ts +192 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +13 -3
- package/dist/server.js.map +5 -5
- package/docs/PERSISTENT-CREDENTIALS.md +15 -0
- package/package.json +1 -1
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
|
|
64
|
-
//
|
|
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
|
-
//
|
|
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=
|
|
8634
|
+
//# debugId=E30FD38FB40CAD6A64756E2164756E21
|
|
8631
8635
|
//# sourceMappingURL=manifest.js.map
|