@absolutejs/auth 0.26.0-beta.5 → 0.26.0-beta.6
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/index.js +3 -1
- package/dist/index.js.map +3 -3
- package/dist/types.d.ts +6 -0
- package/dist/utils.d.ts +2 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -274,6 +274,12 @@ export type AuthConfig<UserType> = {
|
|
|
274
274
|
onProfileError?: OnProfileError;
|
|
275
275
|
onSessionCleanup?: OnSessionCleanup<UserType>;
|
|
276
276
|
};
|
|
277
|
+
/** The serializable subset of `AuthConfig` — the route paths, session durations, and
|
|
278
|
+
* limits that can live in a data file (`auth.config.ts` via `defineAuthSettings`) and
|
|
279
|
+
* be edited from tooling, separate from the code wiring (stores, hooks, callbacks)
|
|
280
|
+
* that stays in the `auth()` call. Spread alongside the rest:
|
|
281
|
+
* `auth({ ...defineAuthSettings({...}), authSessionStore, providersConfiguration })`. */
|
|
282
|
+
export type AuthSettings = Pick<AuthConfig<unknown>, 'authorizeRoute' | 'callbackRoute' | 'cleanupIntervalMs' | 'maxSessions' | 'profileRoute' | 'refreshRoute' | 'revokeRoute' | 'sessionDurationMs' | 'signoutRoute' | 'statusRoute' | 'unregisteredSessionDurationMs'>;
|
|
277
283
|
export type ClientProviderEntry = {
|
|
278
284
|
clientName?: string;
|
|
279
285
|
providerInstance: OAuth2Client<ProviderOption>;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { OAuth2Client, OAuth2TokenResponse, ProviderOption } from 'citra';
|
|
2
2
|
import { Cookie } from 'elysia';
|
|
3
3
|
import { AuthHtmxConfig } from './htmx/types';
|
|
4
|
-
import { AuthConfig, InsantiateUserSessionProps, OAuth2ConfigurationOptions, ResolvedOAuthAuthorization, SessionRecord, UnregisteredSessionRecord, UserSessionId } from './types';
|
|
4
|
+
import { AuthConfig, AuthSettings, InsantiateUserSessionProps, OAuth2ConfigurationOptions, ResolvedOAuthAuthorization, SessionRecord, UnregisteredSessionRecord, UserSessionId } from './types';
|
|
5
5
|
export declare const defineAuthConfig: <UserType>(configuration: AuthConfig<UserType>) => AuthConfig<UserType>;
|
|
6
6
|
export declare const defineAuthHtmxConfig: (htmxConfig: AuthHtmxConfig) => AuthHtmxConfig;
|
|
7
|
+
export declare const defineAuthSettings: (settings: AuthSettings) => AuthSettings;
|
|
7
8
|
export declare const defineProvidersConfiguration: (providersConfiguration: OAuth2ConfigurationOptions) => OAuth2ConfigurationOptions;
|
|
8
9
|
export declare const getStatus: <UserType>(session: SessionRecord<UserType>, user_session_id: Cookie<UserSessionId | undefined>) => Promise<{
|
|
9
10
|
error: {
|
package/package.json
CHANGED