@aura-stack/auth 0.7.0 → 0.7.2
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/@types/index.cjs +1 -0
- package/dist/@types/index.d.ts +2 -2
- package/dist/@types/index.js +1 -0
- package/dist/{assert-hDwQ_SPO.cjs → assert-DaZSf4SH.cjs} +1 -1
- package/dist/{assert-_fBNnaOk.js → assert-av6s0a6t.js} +1 -1
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/{crypto-D6_SoGMH.cjs → crypto-BF4ETYC9.cjs} +1 -1
- package/dist/{crypto-DyrRzBSQ.js → crypto-D6aq4c8x.js} +1 -1
- package/dist/identity-n3aahaEr.cjs +1 -0
- package/dist/{index-C9U6ICDT.d.ts → index-1ADcIVGC.d.ts} +229 -279
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{logger-DjXkgSn5.js → logger-BfUjjtxf.js} +1 -1
- package/dist/{logger-G5PinyEc.cjs → logger-CVwkloPj.cjs} +1 -1
- package/dist/oauth/atlassian.d.ts +1 -1
- package/dist/oauth/bitbucket.d.ts +1 -1
- package/dist/oauth/click-up.d.ts +1 -1
- package/dist/oauth/discord.d.ts +1 -1
- package/dist/oauth/dribbble.d.ts +1 -1
- package/dist/oauth/dropbox.d.ts +1 -1
- package/dist/oauth/figma.d.ts +1 -1
- package/dist/oauth/github.d.ts +1 -1
- package/dist/oauth/gitlab.d.ts +1 -1
- package/dist/oauth/index.cjs +1 -1
- package/dist/oauth/index.d.ts +1 -1
- package/dist/oauth/index.js +1 -1
- package/dist/oauth/mailchimp.d.ts +1 -1
- package/dist/oauth/notion.cjs +1 -1
- package/dist/oauth/notion.d.ts +1 -1
- package/dist/oauth/notion.js +1 -1
- package/dist/oauth/pinterest.d.ts +1 -1
- package/dist/oauth/spotify.d.ts +1 -1
- package/dist/oauth/strava.d.ts +1 -1
- package/dist/oauth/twitch.cjs +1 -1
- package/dist/oauth/twitch.d.ts +1 -1
- package/dist/oauth/twitch.js +1 -1
- package/dist/oauth/x.d.ts +1 -1
- package/dist/shared/cookies.cjs +1 -0
- package/dist/shared/cookies.d.ts +1 -0
- package/dist/shared/cookies.js +1 -0
- package/dist/shared/crypto.cjs +1 -1
- package/dist/shared/crypto.d.ts +1 -1
- package/dist/shared/crypto.js +1 -1
- package/dist/shared/identity.cjs +1 -1
- package/dist/shared/identity.d.ts +1 -1
- package/dist/shared/identity.js +1 -1
- package/dist/shared/index.cjs +1 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/package.json +24 -5
- package/dist/identity-b8FCr0Oa.cjs +0 -1
- package/dist/oauth-D3_mnBOx.js +0 -1
- package/dist/oauth-gPiWxjBd.cjs +0 -1
- /package/dist/{env-CJtSi1eX.js → env-BG1x-kSX.js} +0 -0
- /package/dist/{env-7as-tgzO.cjs → env-BhQ2k7jj.cjs} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as _$_aura_stack_router0 from "@aura-stack/router";
|
|
2
2
|
import { ClientOptions, GlobalContext } from "@aura-stack/router";
|
|
3
3
|
import { ZodObject, ZodRawShape, ZodTypeAny, infer as __Infer, z } from "zod/v4";
|
|
4
|
+
import { Type } from "arktype";
|
|
5
|
+
import { TObject, TProperties, TSchema, Type as Type$1 } from "typebox";
|
|
4
6
|
import { JWK, JWTPayload } from "@aura-stack/jose/jose";
|
|
5
|
-
import { DecodeJWTOptions, EncodeJWTOptions, JWEHeaderParameters, JWTDecryptOptions, JWTHeaderParameters, JWTVerifyOptions,
|
|
7
|
+
import { DecodeJWTOptions, EncodeJWTOptions, JWEHeaderParameters, JWTDecryptOptions, JWTHeaderParameters, JWTVerifyOptions, TypedJWTPayload, TypedJWTPayload as TypedJWTPayload$1 } from "@aura-stack/jose";
|
|
6
8
|
import { SerializeOptions } from "@aura-stack/router/cookie";
|
|
7
9
|
import * as valibot from "valibot";
|
|
8
10
|
import { AnySchema, BaseSchema, InferOutput, ObjectEntries, ObjectSchema } from "valibot";
|
|
9
|
-
import { Type } from "arktype";
|
|
10
|
-
import { Static, TObject, TProperties, TSchema, Type as Type$1 } from "typebox";
|
|
11
11
|
import * as _$arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
|
|
12
12
|
import * as _$zod_v4_core0 from "zod/v4/core";
|
|
13
13
|
import { infer as infer$1 } from "zod/v4/core";
|
|
@@ -193,8 +193,8 @@ type IsArkType<T extends Identities> = T extends EditableShapeArkType<UserShapeA
|
|
|
193
193
|
type IsZod<T extends Identities> = T extends EditableShape<UserShape> ? true : false;
|
|
194
194
|
type IsValibot<T extends Identities> = T extends EditableShapeValibot<UserShapeValibot> ? true : false;
|
|
195
195
|
type SchemaTypes = ZodObject<any> | valibot.ObjectSchema<any, undefined> | Type<{}> | Type$1.TObject;
|
|
196
|
-
type Identities = EditableShape<UserShape> | EditableShapeValibot<UserShapeValibot> | EditableShapeArkType<UserShapeArkType> | EditableShapeTypebox<UserShapeTypeBox
|
|
197
|
-
type ReturnShapeType<T> = T extends EditableShape<UserShape> ? z.ZodObject<T> : T extends EditableShapeValibot<UserShapeValibot> ? valibot.ObjectSchema<T, undefined> : T extends EditableShapeArkType<UserShapeArkType> ? T : T extends EditableShapeTypebox<UserShapeTypeBox> ? Type$1.TObject<T> : never;
|
|
196
|
+
type Identities = EditableShape<UserShape> | EditableShapeValibot<UserShapeValibot> | EditableShapeArkType<UserShapeArkType> | EditableShapeTypebox<UserShapeTypeBox> | EditableUser;
|
|
197
|
+
type ReturnShapeType<T> = T extends EditableShape<UserShape> ? z.ZodObject<T> : T extends EditableShapeValibot<UserShapeValibot> ? valibot.ObjectSchema<T, undefined> : T extends EditableShapeArkType<UserShapeArkType> ? T : T extends EditableShapeTypebox<UserShapeTypeBox> ? Type$1.TObject<T> : T extends EditableUser ? z.ZodObject<T> : never;
|
|
198
198
|
declare const createIdentity: <S extends Identities>(shape: S) => ReturnShapeType<S>;
|
|
199
199
|
//#endregion
|
|
200
200
|
//#region src/shared/logger.d.ts
|
|
@@ -1345,7 +1345,7 @@ type JWTSealedMode = {
|
|
|
1345
1345
|
type JWTConfigBase = JWTSignedMode | JWTEncryptedMode | JWTSealedMode;
|
|
1346
1346
|
/** How session/JWT lifetime is enforced relative to `iat`, absolute caps, and sliding windows. */
|
|
1347
1347
|
type JWTExpirationStrategy = "fixed" | "rolling" | "absolute" | "sliding";
|
|
1348
|
-
type JWTConfig = Prettify
|
|
1348
|
+
type JWTConfig = Prettify<{
|
|
1349
1349
|
/**
|
|
1350
1350
|
* Token lifetime.
|
|
1351
1351
|
*/
|
|
@@ -1752,21 +1752,21 @@ type TrustedProxyHeadersConfig = {
|
|
|
1752
1752
|
*/
|
|
1753
1753
|
type SecureCookie = {
|
|
1754
1754
|
strategy: "secure";
|
|
1755
|
-
} & Prettify
|
|
1755
|
+
} & Prettify<Omit<SerializeOptions, "secure" | "encode">>;
|
|
1756
1756
|
/**
|
|
1757
1757
|
* Cookie type with __Host- prefix, must be Secure, Path=/, no Domain attribute.
|
|
1758
1758
|
* @see https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html#name-the-__host-prefix
|
|
1759
1759
|
*/
|
|
1760
1760
|
type HostCookie = {
|
|
1761
1761
|
strategy: "host";
|
|
1762
|
-
} & Prettify
|
|
1762
|
+
} & Prettify<Omit<SerializeOptions, "secure" | "path" | "domain" | "encode">>;
|
|
1763
1763
|
/**
|
|
1764
1764
|
* Standard cookie type without security prefixes.
|
|
1765
1765
|
* Can be sent over both HTTP and HTTPS connections (default in development).
|
|
1766
1766
|
*/
|
|
1767
1767
|
type StandardCookie = {
|
|
1768
1768
|
strategy?: "standard";
|
|
1769
|
-
} & Prettify
|
|
1769
|
+
} & Prettify<Omit<SerializeOptions, "encode">>;
|
|
1770
1770
|
/**
|
|
1771
1771
|
* Union type for cookie options based on the specified strategy.
|
|
1772
1772
|
* - `secure`: Cookies are only sent over HTTPS connections
|
|
@@ -1953,7 +1953,7 @@ type InternalContext<Identity extends Identities> = RouterGlobalContext<FromShap
|
|
|
1953
1953
|
//#endregion
|
|
1954
1954
|
//#region src/@types/utility.d.ts
|
|
1955
1955
|
/** Expands intersection types into a single flat object type for readable editor hints. */
|
|
1956
|
-
type Prettify
|
|
1956
|
+
type Prettify<T> = { [K in keyof T]: T[K] };
|
|
1957
1957
|
/**
|
|
1958
1958
|
* A string that must be one of the literals in `T`, or any other string (`U`).
|
|
1959
1959
|
* Useful for autocomplete on known keys while still allowing custom values.
|
|
@@ -1967,10 +1967,11 @@ type EditableShapeZod<T extends ZodRawShape> = EditableShape<T>;
|
|
|
1967
1967
|
type AnyShape = Record<string, AnySchema>;
|
|
1968
1968
|
type EditableShapeValibot<T extends ObjectEntries> = { [K in keyof T]: T[K] extends ObjectSchema<infer Inner extends AnyShape, undefined> ? ObjectSchema<EditableShapeValibot<Inner>, undefined> : BaseSchema<any, any, any> };
|
|
1969
1969
|
type EditableShapeTypebox<T extends TProperties> = { [K in keyof T]: T[K] extends TObject ? Wrap<EditableShapeTypebox<T[K]["properties"]>> : TSchema };
|
|
1970
|
+
type EditableUser = { [K in keyof User]: any };
|
|
1970
1971
|
type ConfigSchema<T extends Identities> = IsZod<T> extends true ? ZodObject<T & ZodRawShape> : T extends EditableShapeValibot<UserShapeValibot> ? ObjectSchema<T & ObjectEntries, undefined> : IsArkType<T> extends true ? T : T extends EditableShapeTypebox<UserShapeTypeBox> ? TObject<T & TProperties> : never;
|
|
1971
1972
|
type ValibotShapeToObject<S extends ObjectEntries> = Merge<InferOutput<ObjectSchema<S, undefined>>, User>;
|
|
1972
1973
|
type ArktypeShapeToObject<S extends Type> = S extends Type<infer Shape> ? Wrap<Merge<Shape, User>> : never;
|
|
1973
|
-
type TypeboxShapeToObject<S
|
|
1974
|
+
type TypeboxShapeToObject<S> = Wrap<Merge<S, User>>;
|
|
1974
1975
|
type EditableShapeArkType<T extends Type> = T extends Type<infer Shape> ? Type<{ [K in keyof Shape]: any }> : never;
|
|
1975
1976
|
/** Merges type `B` over `A`, replacing overlapping keys with `B`. */
|
|
1976
1977
|
type Merge<A, B> = Omit<A, keyof B> & B;
|
|
@@ -1979,7 +1980,7 @@ type Merge<A, B> = Omit<A, keyof B> & B;
|
|
|
1979
1980
|
* so identity fields always include the base user contract.
|
|
1980
1981
|
*/
|
|
1981
1982
|
type ZodShapeToObject<S extends ZodRawShape = ZodRawShape> = Merge<__Infer<ZodObject<S>>, User>;
|
|
1982
|
-
type FromShapeToObject<S> = S extends ZodRawShape ? ZodShapeToObject<S> : S extends ObjectEntries ? ValibotShapeToObject<S> : S extends Type ? ArktypeShapeToObject<S> : S extends TProperties ? TypeboxShapeToObject<S> : never;
|
|
1983
|
+
type FromShapeToObject<S> = S extends ZodRawShape ? ZodShapeToObject<S> : S extends ObjectEntries ? ValibotShapeToObject<S> : S extends Type ? ArktypeShapeToObject<S> : S extends TProperties ? TypeboxShapeToObject<S> : S extends User ? S : never;
|
|
1983
1984
|
/** Recursively makes every property required. */
|
|
1984
1985
|
type DeepRequired<T> = { [K in keyof T]-?: T[K] extends object ? DeepRequired<T[K]> : T[K] };
|
|
1985
1986
|
/** Recursively makes every property optional. */
|
|
@@ -1999,7 +2000,7 @@ type Wrap<T> = T extends any ? { [K in keyof T]: T[K] } : never;
|
|
|
1999
2000
|
*
|
|
2000
2001
|
* type User = InferUser<typeof auth>
|
|
2001
2002
|
*/
|
|
2002
|
-
type InferUser<Config extends AuthInstance> = Config extends AuthInstance<infer Identity> ? Prettify
|
|
2003
|
+
type InferUser<Config extends AuthInstance> = Config extends AuthInstance<infer Identity> ? Prettify<Identity> : User;
|
|
2003
2004
|
/**
|
|
2004
2005
|
* Infers the session type from an {@link AuthInstance} config.
|
|
2005
2006
|
* @example
|
|
@@ -2013,7 +2014,7 @@ type InferUser<Config extends AuthInstance> = Config extends AuthInstance<infer
|
|
|
2013
2014
|
*
|
|
2014
2015
|
* type Session = InferSession<typeof auth>
|
|
2015
2016
|
*/
|
|
2016
|
-
type InferSession<Config extends AuthInstance> = Prettify
|
|
2017
|
+
type InferSession<Config extends AuthInstance> = Prettify<Session<Wrap<InferUser<Config>>>>;
|
|
2017
2018
|
/**
|
|
2018
2019
|
* Shorthand for a Zod object’s `.shape` property.
|
|
2019
2020
|
*/
|
|
@@ -2029,7 +2030,7 @@ type InferZodShape<T extends ZodObject> = T["shape"];
|
|
|
2029
2030
|
*
|
|
2030
2031
|
* type User = UserFrom<typeof schema>
|
|
2031
2032
|
*/
|
|
2032
|
-
type UserFrom<T extends ZodObject> = Prettify
|
|
2033
|
+
type UserFrom<T extends ZodObject> = Prettify<ZodShapeToObject<InferZodShape<T>>>;
|
|
2033
2034
|
/**
|
|
2034
2035
|
* Infers the session type from a Zod identity schema.
|
|
2035
2036
|
* @example
|
|
@@ -2045,13 +2046,14 @@ type SessionFrom<T extends ZodObject> = Wrap<Session<Wrap<UserFrom<T>>>>;
|
|
|
2045
2046
|
/**
|
|
2046
2047
|
* HTTP `Response` with `json()` typed to resolve to `Body` (defaults to `unknown`).
|
|
2047
2048
|
*/
|
|
2048
|
-
type AuthResponse<Body = unknown> = Prettify
|
|
2049
|
+
type AuthResponse<Body = unknown> = Prettify<Omit<Response, "json"> & {
|
|
2049
2050
|
json(): Promise<Body>;
|
|
2050
2051
|
}>;
|
|
2052
|
+
type RequiredKeys<Obj extends object, Keys extends keyof Obj = keyof Obj> = Wrap<{ [K in Keys]-?: Obj[K] } & Omit<Obj, Keys>>;
|
|
2051
2053
|
//#endregion
|
|
2052
2054
|
//#region src/createAuth.d.ts
|
|
2053
2055
|
declare const createAuthInstance: <Identity extends Identities>(authConfig: AuthConfig<Identity>) => {
|
|
2054
|
-
handlers: _$_aura_stack_router0.Router<[_$_aura_stack_router0.RouteEndpoint<"
|
|
2056
|
+
handlers: _$_aura_stack_router0.Router<[_$_aura_stack_router0.RouteEndpoint<"/signIn/:oauth", _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2055
2057
|
schemas?: {
|
|
2056
2058
|
params: _$zod.ZodObject<{
|
|
2057
2059
|
oauth: _$zod.ZodEnum<{
|
|
@@ -2079,107 +2081,85 @@ declare const createAuthInstance: <Identity extends Identities>(authConfig: Auth
|
|
|
2079
2081
|
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2080
2082
|
}, _$zod_v4_core0.$strip>;
|
|
2081
2083
|
} | undefined;
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
}, (ctx: {
|
|
2110
|
-
params: {
|
|
2111
|
-
oauth: "github" | "bitbucket" | "figma" | "discord" | "gitlab" | "spotify" | "x" | "strava" | "mailchimp" | "pinterest" | "twitch" | "notion" | "dropbox" | "atlassian" | "clickUp" | "dribbble" | (string & Record<never, never>);
|
|
2112
|
-
};
|
|
2113
|
-
body: undefined;
|
|
2114
|
-
searchParams: {
|
|
2115
|
-
redirect: boolean;
|
|
2116
|
-
redirectTo?: string | undefined;
|
|
2117
|
-
};
|
|
2118
|
-
headers: _$_aura_stack_router0.HeadersBuilder;
|
|
2119
|
-
request: Request;
|
|
2120
|
-
url: URL;
|
|
2121
|
-
method: "GET";
|
|
2122
|
-
route: "/signIn/:oauth";
|
|
2123
|
-
context: _$_aura_stack_router0.GlobalContext;
|
|
2124
|
-
json: <T>(data: T, init?: ResponseInit) => _$_aura_stack_router0.JsonResponse<T>;
|
|
2125
|
-
}) => Promise<Prettify$1<Omit<Response, "json"> & {
|
|
2084
|
+
}, (ctx: _$_aura_stack_router0.RequestContext<_$_aura_stack_router0.EndpointMeta<"/signIn/:oauth", _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2085
|
+
params: _$zod.ZodObject<{
|
|
2086
|
+
oauth: _$zod.ZodEnum<{
|
|
2087
|
+
[x: string & Record<never, never>]: string & Record<never, never>;
|
|
2088
|
+
github: "github";
|
|
2089
|
+
bitbucket: "bitbucket";
|
|
2090
|
+
figma: "figma";
|
|
2091
|
+
discord: "discord";
|
|
2092
|
+
gitlab: "gitlab";
|
|
2093
|
+
spotify: "spotify";
|
|
2094
|
+
x: "x";
|
|
2095
|
+
strava: "strava";
|
|
2096
|
+
mailchimp: "mailchimp";
|
|
2097
|
+
pinterest: "pinterest";
|
|
2098
|
+
twitch: "twitch";
|
|
2099
|
+
notion: "notion";
|
|
2100
|
+
dropbox: "dropbox";
|
|
2101
|
+
atlassian: "atlassian";
|
|
2102
|
+
clickUp: "clickUp";
|
|
2103
|
+
dribbble: "dribbble";
|
|
2104
|
+
}>;
|
|
2105
|
+
}, _$zod_v4_core0.$strip>;
|
|
2106
|
+
searchParams: _$zod.ZodObject<{
|
|
2107
|
+
redirect: _$zod.ZodDefault<_$zod.ZodOptional<_$zod.ZodCodec<_$zod.ZodString, _$zod.ZodBoolean>>>;
|
|
2108
|
+
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2109
|
+
}, _$zod_v4_core0.$strip>;
|
|
2110
|
+
}>>) => Promise<Prettify<Omit<Response, "json"> & {
|
|
2126
2111
|
json(): Promise<{
|
|
2127
2112
|
success: true;
|
|
2128
2113
|
redirect: boolean;
|
|
2129
2114
|
signInURL: string;
|
|
2130
2115
|
}>;
|
|
2131
|
-
}> | Prettify
|
|
2116
|
+
}> | Prettify<Omit<Response, "json"> & {
|
|
2132
2117
|
json(): Promise<{
|
|
2133
2118
|
success: false;
|
|
2134
2119
|
redirect: false;
|
|
2135
2120
|
signInURL: null;
|
|
2136
2121
|
}>;
|
|
2137
|
-
}>>>, _$_aura_stack_router0.RouteEndpoint
|
|
2122
|
+
}>>>, _$_aura_stack_router0.RouteEndpoint<`/${string}`, _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2138
2123
|
schemas?: {
|
|
2139
2124
|
body: _$zod.ZodObject<{
|
|
2140
2125
|
username: _$zod.ZodString;
|
|
2141
2126
|
password: _$zod.ZodString;
|
|
2142
2127
|
}, _$zod_v4_core0.$strip>;
|
|
2143
2128
|
searchParams: _$zod.ZodObject<{
|
|
2129
|
+
redirect: _$zod.ZodDefault<_$zod.ZodOptional<_$zod.ZodCodec<_$zod.ZodString, _$zod.ZodBoolean>>>;
|
|
2144
2130
|
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2145
2131
|
}, _$zod_v4_core0.$strip>;
|
|
2146
2132
|
} | undefined;
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
}
|
|
2156
|
-
},
|
|
2157
|
-
params: {};
|
|
2158
|
-
body: {
|
|
2159
|
-
username: string;
|
|
2160
|
-
password: string;
|
|
2161
|
-
};
|
|
2162
|
-
searchParams: {
|
|
2163
|
-
redirectTo?: string | undefined;
|
|
2164
|
-
};
|
|
2165
|
-
headers: _$_aura_stack_router0.HeadersBuilder;
|
|
2166
|
-
request: Request;
|
|
2167
|
-
url: URL;
|
|
2168
|
-
method: "POST";
|
|
2169
|
-
route: `/${string}`;
|
|
2170
|
-
context: _$_aura_stack_router0.GlobalContext;
|
|
2171
|
-
json: <T>(data: T, init?: ResponseInit) => _$_aura_stack_router0.JsonResponse<T>;
|
|
2172
|
-
}) => Promise<Prettify$1<Omit<Response, "json"> & {
|
|
2133
|
+
}, (ctx: _$_aura_stack_router0.RequestContext<_$_aura_stack_router0.EndpointMeta<`/${string}`, _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2134
|
+
body: _$zod.ZodObject<{
|
|
2135
|
+
username: _$zod.ZodString;
|
|
2136
|
+
password: _$zod.ZodString;
|
|
2137
|
+
}, _$zod_v4_core0.$strip>;
|
|
2138
|
+
searchParams: _$zod.ZodObject<{
|
|
2139
|
+
redirect: _$zod.ZodDefault<_$zod.ZodOptional<_$zod.ZodCodec<_$zod.ZodString, _$zod.ZodBoolean>>>;
|
|
2140
|
+
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2141
|
+
}, _$zod_v4_core0.$strip>;
|
|
2142
|
+
}>>) => Promise<Prettify<Omit<Response, "json"> & {
|
|
2173
2143
|
json(): Promise<{
|
|
2174
2144
|
success: true;
|
|
2145
|
+
redirect: true;
|
|
2146
|
+
redirectURL: null;
|
|
2147
|
+
} | {
|
|
2148
|
+
success: true;
|
|
2149
|
+
redirect: false;
|
|
2175
2150
|
redirectURL: string;
|
|
2151
|
+
} | {
|
|
2152
|
+
success: true;
|
|
2153
|
+
redirect: false;
|
|
2154
|
+
redirectURL: null;
|
|
2176
2155
|
}>;
|
|
2177
|
-
}> | Prettify
|
|
2156
|
+
}> | Prettify<Omit<Response, "json"> & {
|
|
2178
2157
|
json(): Promise<{
|
|
2179
2158
|
success: false;
|
|
2159
|
+
redirect: false;
|
|
2180
2160
|
redirectURL: null;
|
|
2181
2161
|
}>;
|
|
2182
|
-
}>>>, _$_aura_stack_router0.RouteEndpoint<"
|
|
2162
|
+
}>>>, _$_aura_stack_router0.RouteEndpoint<"/callback/:oauth", _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2183
2163
|
schemas?: {
|
|
2184
2164
|
params: _$zod.ZodObject<{
|
|
2185
2165
|
oauth: _$zod.ZodEnum<{
|
|
@@ -2207,64 +2187,35 @@ declare const createAuthInstance: <Identity extends Identities>(authConfig: Auth
|
|
|
2207
2187
|
state: _$zod.ZodString;
|
|
2208
2188
|
}, _$zod_v4_core0.$strip>;
|
|
2209
2189
|
} | undefined;
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
}, (ctx: {
|
|
2238
|
-
params: {
|
|
2239
|
-
oauth: "github" | "bitbucket" | "figma" | "discord" | "gitlab" | "spotify" | "x" | "strava" | "mailchimp" | "pinterest" | "twitch" | "notion" | "dropbox" | "atlassian" | "clickUp" | "dribbble" | (string & Record<never, never>);
|
|
2240
|
-
};
|
|
2241
|
-
body: undefined;
|
|
2242
|
-
searchParams: {
|
|
2243
|
-
code: string;
|
|
2244
|
-
state: string;
|
|
2245
|
-
};
|
|
2246
|
-
headers: _$_aura_stack_router0.HeadersBuilder;
|
|
2247
|
-
request: Request;
|
|
2248
|
-
url: URL;
|
|
2249
|
-
method: "GET";
|
|
2250
|
-
route: "/callback/:oauth";
|
|
2251
|
-
context: _$_aura_stack_router0.GlobalContext;
|
|
2252
|
-
json: <T>(data: T, init?: ResponseInit) => _$_aura_stack_router0.JsonResponse<T>;
|
|
2253
|
-
}) => Promise<Response>>, _$_aura_stack_router0.RouteEndpoint<"GET", "/session", {
|
|
2190
|
+
}, (ctx: _$_aura_stack_router0.RequestContext<_$_aura_stack_router0.EndpointMeta<"/callback/:oauth", _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2191
|
+
params: _$zod.ZodObject<{
|
|
2192
|
+
oauth: _$zod.ZodEnum<{
|
|
2193
|
+
[x: string & Record<never, never>]: string & Record<never, never>;
|
|
2194
|
+
github: "github";
|
|
2195
|
+
bitbucket: "bitbucket";
|
|
2196
|
+
figma: "figma";
|
|
2197
|
+
discord: "discord";
|
|
2198
|
+
gitlab: "gitlab";
|
|
2199
|
+
spotify: "spotify";
|
|
2200
|
+
x: "x";
|
|
2201
|
+
strava: "strava";
|
|
2202
|
+
mailchimp: "mailchimp";
|
|
2203
|
+
pinterest: "pinterest";
|
|
2204
|
+
twitch: "twitch";
|
|
2205
|
+
notion: "notion";
|
|
2206
|
+
dropbox: "dropbox";
|
|
2207
|
+
atlassian: "atlassian";
|
|
2208
|
+
clickUp: "clickUp";
|
|
2209
|
+
dribbble: "dribbble";
|
|
2210
|
+
}>;
|
|
2211
|
+
}, _$zod_v4_core0.$strip>;
|
|
2212
|
+
searchParams: _$zod.ZodObject<{
|
|
2213
|
+
code: _$zod.ZodString;
|
|
2214
|
+
state: _$zod.ZodString;
|
|
2215
|
+
}, _$zod_v4_core0.$strip>;
|
|
2216
|
+
}>>) => Promise<Response>>, _$_aura_stack_router0.RouteEndpoint<"/session", "GET", {
|
|
2254
2217
|
schemas?: _$_aura_stack_router0.EndpointSchemas | undefined;
|
|
2255
|
-
|
|
2256
|
-
}, (ctx: {
|
|
2257
|
-
params: {};
|
|
2258
|
-
body: undefined;
|
|
2259
|
-
searchParams: URLSearchParams;
|
|
2260
|
-
headers: _$_aura_stack_router0.HeadersBuilder;
|
|
2261
|
-
request: Request;
|
|
2262
|
-
url: URL;
|
|
2263
|
-
method: "GET";
|
|
2264
|
-
route: "/session";
|
|
2265
|
-
context: _$_aura_stack_router0.GlobalContext;
|
|
2266
|
-
json: <T>(data: T, init?: ResponseInit) => _$_aura_stack_router0.JsonResponse<T>;
|
|
2267
|
-
}) => Promise<Prettify$1<Omit<Response, "json"> & {
|
|
2218
|
+
}, (ctx: _$_aura_stack_router0.RequestContext<_$_aura_stack_router0.EndpointMeta<"/session", "GET", _$_aura_stack_router0.EndpointSchemas>>) => Promise<Prettify<Omit<Response, "json"> & {
|
|
2268
2219
|
json(): Promise<{
|
|
2269
2220
|
success: true;
|
|
2270
2221
|
session: Session<{
|
|
@@ -2274,83 +2225,62 @@ declare const createAuthInstance: <Identity extends Identities>(authConfig: Auth
|
|
|
2274
2225
|
email?: string | null | undefined;
|
|
2275
2226
|
}>;
|
|
2276
2227
|
}>;
|
|
2277
|
-
}> | Prettify
|
|
2228
|
+
}> | Prettify<Omit<Response, "json"> & {
|
|
2278
2229
|
json(): Promise<{
|
|
2279
2230
|
success: false;
|
|
2280
2231
|
session: null;
|
|
2281
2232
|
}>;
|
|
2282
|
-
}>>>, _$_aura_stack_router0.RouteEndpoint
|
|
2233
|
+
}>>>, _$_aura_stack_router0.RouteEndpoint<`/${string}`, _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2283
2234
|
schemas?: {
|
|
2284
2235
|
searchParams: _$zod.ZodObject<{
|
|
2285
|
-
|
|
2236
|
+
redirect: _$zod.ZodDefault<_$zod.ZodOptional<_$zod.ZodCodec<_$zod.ZodString, _$zod.ZodBoolean>>>;
|
|
2286
2237
|
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2287
|
-
}, _$zod_v4_core0.$strip>;
|
|
2288
|
-
} | undefined;
|
|
2289
|
-
use?: _$_aura_stack_router0.MiddlewareFunction<`/${string}`, {
|
|
2290
|
-
searchParams: _$zod.ZodObject<{
|
|
2291
2238
|
token_type_hint: _$zod.ZodLiteral<"session_token">;
|
|
2292
|
-
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2293
2239
|
}, _$zod_v4_core0.$strip>;
|
|
2294
|
-
}
|
|
2295
|
-
}, (ctx: {
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
token_type_hint: "session_token"
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
headers: _$_aura_stack_router0.HeadersBuilder;
|
|
2303
|
-
request: Request;
|
|
2304
|
-
url: URL;
|
|
2305
|
-
method: "POST";
|
|
2306
|
-
route: `/${string}`;
|
|
2307
|
-
context: _$_aura_stack_router0.GlobalContext;
|
|
2308
|
-
json: <T>(data: T, init?: ResponseInit) => _$_aura_stack_router0.JsonResponse<T>;
|
|
2309
|
-
}) => Promise<Prettify$1<Omit<Response, "json"> & {
|
|
2240
|
+
} | undefined;
|
|
2241
|
+
}, (ctx: _$_aura_stack_router0.RequestContext<_$_aura_stack_router0.EndpointMeta<`/${string}`, _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2242
|
+
searchParams: _$zod.ZodObject<{
|
|
2243
|
+
redirect: _$zod.ZodDefault<_$zod.ZodOptional<_$zod.ZodCodec<_$zod.ZodString, _$zod.ZodBoolean>>>;
|
|
2244
|
+
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2245
|
+
token_type_hint: _$zod.ZodLiteral<"session_token">;
|
|
2246
|
+
}, _$zod_v4_core0.$strip>;
|
|
2247
|
+
}>>) => Promise<Prettify<Omit<Response, "json"> & {
|
|
2310
2248
|
json(): Promise<{
|
|
2311
2249
|
success: true;
|
|
2312
|
-
redirect:
|
|
2250
|
+
redirect: true;
|
|
2251
|
+
redirectURL: null;
|
|
2252
|
+
} | {
|
|
2253
|
+
success: true;
|
|
2254
|
+
redirect: false;
|
|
2313
2255
|
redirectURL: string;
|
|
2256
|
+
} | {
|
|
2257
|
+
success: true;
|
|
2258
|
+
redirect: false;
|
|
2259
|
+
redirectURL: null;
|
|
2314
2260
|
}>;
|
|
2315
|
-
}> | Prettify
|
|
2261
|
+
}> | Prettify<Omit<Response, "json"> & {
|
|
2316
2262
|
json(): Promise<{
|
|
2317
2263
|
success: false;
|
|
2318
|
-
redirect:
|
|
2264
|
+
redirect: false;
|
|
2319
2265
|
redirectURL: null;
|
|
2320
2266
|
}>;
|
|
2321
|
-
}>>>, _$_aura_stack_router0.RouteEndpoint<"
|
|
2267
|
+
}>>>, _$_aura_stack_router0.RouteEndpoint<"/csrfToken", "GET", {
|
|
2322
2268
|
schemas?: _$_aura_stack_router0.EndpointSchemas | undefined;
|
|
2323
|
-
|
|
2324
|
-
}, (ctx: {
|
|
2325
|
-
params: {};
|
|
2326
|
-
body: undefined;
|
|
2327
|
-
searchParams: URLSearchParams;
|
|
2328
|
-
headers: _$_aura_stack_router0.HeadersBuilder;
|
|
2329
|
-
request: Request;
|
|
2330
|
-
url: URL;
|
|
2331
|
-
method: "GET";
|
|
2332
|
-
route: "/csrfToken";
|
|
2333
|
-
context: _$_aura_stack_router0.GlobalContext;
|
|
2334
|
-
json: <T>(data: T, init?: ResponseInit) => _$_aura_stack_router0.JsonResponse<T>;
|
|
2335
|
-
}) => Promise<Response>>, _$_aura_stack_router0.RouteEndpoint<"PATCH", `/${string}`, {
|
|
2269
|
+
}, (ctx: _$_aura_stack_router0.RequestContext<_$_aura_stack_router0.EndpointMeta<"/csrfToken", "GET", _$_aura_stack_router0.EndpointSchemas>>) => Promise<Response>>, _$_aura_stack_router0.RouteEndpoint<`/${string}`, _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2336
2270
|
schemas?: {
|
|
2337
2271
|
body: any;
|
|
2272
|
+
searchParams: _$zod.ZodObject<{
|
|
2273
|
+
redirect: _$zod.ZodDefault<_$zod.ZodOptional<_$zod.ZodCodec<_$zod.ZodString, _$zod.ZodBoolean>>>;
|
|
2274
|
+
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2275
|
+
}, _$zod_v4_core0.$strip>;
|
|
2338
2276
|
} | undefined;
|
|
2339
|
-
|
|
2340
|
-
body: any;
|
|
2341
|
-
}>[] | undefined;
|
|
2342
|
-
}, (ctx: {
|
|
2343
|
-
params: {};
|
|
2277
|
+
}, (ctx: _$_aura_stack_router0.RequestContext<_$_aura_stack_router0.EndpointMeta<`/${string}`, _$_aura_stack_router0.HTTPMethod | _$_aura_stack_router0.HTTPMethod[], {
|
|
2344
2278
|
body: any;
|
|
2345
|
-
searchParams:
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
route: `/${string}`;
|
|
2351
|
-
context: _$_aura_stack_router0.GlobalContext;
|
|
2352
|
-
json: <T>(data: T, init?: ResponseInit) => _$_aura_stack_router0.JsonResponse<T>;
|
|
2353
|
-
}) => Promise<Prettify$1<Omit<Response, "json"> & {
|
|
2279
|
+
searchParams: _$zod.ZodObject<{
|
|
2280
|
+
redirect: _$zod.ZodDefault<_$zod.ZodOptional<_$zod.ZodCodec<_$zod.ZodString, _$zod.ZodBoolean>>>;
|
|
2281
|
+
redirectTo: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2282
|
+
}, _$zod_v4_core0.$strip>;
|
|
2283
|
+
}>>) => Promise<Prettify<Omit<Response, "json"> & {
|
|
2354
2284
|
json(): Promise<{
|
|
2355
2285
|
success: true;
|
|
2356
2286
|
session: Session<{
|
|
@@ -2359,12 +2289,34 @@ declare const createAuthInstance: <Identity extends Identities>(authConfig: Auth
|
|
|
2359
2289
|
image?: string | null | undefined;
|
|
2360
2290
|
email?: string | null | undefined;
|
|
2361
2291
|
}>;
|
|
2292
|
+
redirect: true;
|
|
2293
|
+
redirectURL: null;
|
|
2294
|
+
} | {
|
|
2295
|
+
success: true;
|
|
2296
|
+
session: Session<{
|
|
2297
|
+
sub: string;
|
|
2298
|
+
name?: string | null | undefined;
|
|
2299
|
+
image?: string | null | undefined;
|
|
2300
|
+
email?: string | null | undefined;
|
|
2301
|
+
}>;
|
|
2302
|
+
redirect: false;
|
|
2362
2303
|
redirectURL: string;
|
|
2304
|
+
} | {
|
|
2305
|
+
success: true;
|
|
2306
|
+
session: Session<{
|
|
2307
|
+
sub: string;
|
|
2308
|
+
name?: string | null | undefined;
|
|
2309
|
+
image?: string | null | undefined;
|
|
2310
|
+
email?: string | null | undefined;
|
|
2311
|
+
}>;
|
|
2312
|
+
redirect: false;
|
|
2313
|
+
redirectURL: null;
|
|
2363
2314
|
}>;
|
|
2364
|
-
}> | Prettify
|
|
2315
|
+
}> | Prettify<Omit<Response, "json"> & {
|
|
2365
2316
|
json(): Promise<{
|
|
2366
2317
|
success: false;
|
|
2367
2318
|
session: null;
|
|
2319
|
+
redirect: false;
|
|
2368
2320
|
redirectURL: null;
|
|
2369
2321
|
}>;
|
|
2370
2322
|
}>>>]>;
|
|
@@ -2451,7 +2403,7 @@ type ErrorType = AuthorizationError["error"] | AccessTokenError["error"] | Token
|
|
|
2451
2403
|
* Machine-readable codes for internal auth failures (configuration, crypto, environment, etc.).
|
|
2452
2404
|
* Used with {@link AuthInternalError} and logging.
|
|
2453
2405
|
*/
|
|
2454
|
-
type AuthInternalErrorCode = "INVALID_OAUTH_CONFIGURATION" | "INVALID_JWT_TOKEN" | "JOSE_INITIALIZATION_FAILED" | "SESSION_STORE_NOT_INITIALIZED" | "COOKIE_STORE_NOT_INITIALIZED" | "COOKIE_PARSING_FAILED" | "COOKIE_NOT_FOUND" | "INVALID_ENVIRONMENT_CONFIGURATION" | "INVALID_URL" | "INVALID_SALT_SECRET_VALUE" | "UNTRUSTED_ORIGIN" | "INVALID_OAUTH_PROVIDER_CONFIGURATION" | "DUPLICATED_OAUTH_PROVIDER_ID" | "CREDENTIALS_PROVIDER_NOT_CONFIGURED" | "IDENTITY_VALIDATION_FAILED";
|
|
2406
|
+
type AuthInternalErrorCode = "INVALID_OAUTH_CONFIGURATION" | "INVALID_JWT_TOKEN" | "JOSE_INITIALIZATION_FAILED" | "SESSION_STORE_NOT_INITIALIZED" | "COOKIE_STORE_NOT_INITIALIZED" | "COOKIE_PARSING_FAILED" | "COOKIE_NOT_FOUND" | "INVALID_ENVIRONMENT_CONFIGURATION" | "INVALID_URL" | "INVALID_SALT_SECRET_VALUE" | "UNTRUSTED_ORIGIN" | "INVALID_OAUTH_PROVIDER_CONFIGURATION" | "DUPLICATED_OAUTH_PROVIDER_ID" | "CREDENTIALS_PROVIDER_NOT_CONFIGURED" | "IDENTITY_VALIDATION_FAILED" | "UPDATE_SESSION_INVALID";
|
|
2455
2407
|
/**
|
|
2456
2408
|
* Machine-readable codes for security-sensitive failures (CSRF, session, open redirect, OAuth state).
|
|
2457
2409
|
*/
|
|
@@ -2521,7 +2473,7 @@ interface APIOptionsWithRedirectTo {
|
|
|
2521
2473
|
/**
|
|
2522
2474
|
* Optional redirect strategy for server/programmatic API functions.
|
|
2523
2475
|
*
|
|
2524
|
-
* - `true`:
|
|
2476
|
+
* - `true`: The response includes a `Location` header.
|
|
2525
2477
|
* - `false`: the API returns redirect data (`signInURL` or `redirectURL`) for custom handling.
|
|
2526
2478
|
*
|
|
2527
2479
|
* Defaults are action-specific; see each API option type.
|
|
@@ -2643,16 +2595,32 @@ interface SignInCredentialsOptions extends OptionsWithRedirectTo {
|
|
|
2643
2595
|
*/
|
|
2644
2596
|
payload: CredentialsPayload;
|
|
2645
2597
|
}
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
redirect:
|
|
2649
|
-
|
|
2598
|
+
type SignInCredentialsReturnData = /** redirect: true & redirectTo: string */{
|
|
2599
|
+
success: true;
|
|
2600
|
+
redirect: true;
|
|
2601
|
+
redirectURL: null;
|
|
2602
|
+
} /** redirect: false & redirectTo: string */ | {
|
|
2650
2603
|
success: true;
|
|
2604
|
+
redirect: false;
|
|
2651
2605
|
redirectURL: string;
|
|
2652
|
-
}
|
|
2606
|
+
}
|
|
2607
|
+
/** redirect: false & redirectTo: null | undefined (not set) */
|
|
2608
|
+
/** redirect: true & redirectTo: null | undefined (not set) */
|
|
2609
|
+
| {
|
|
2610
|
+
success: true;
|
|
2611
|
+
redirect: false;
|
|
2612
|
+
redirectURL: null;
|
|
2613
|
+
} /** Failed credentials */ | {
|
|
2653
2614
|
success: false;
|
|
2615
|
+
redirect: false;
|
|
2654
2616
|
redirectURL: null;
|
|
2655
|
-
}
|
|
2617
|
+
};
|
|
2618
|
+
/** Client-side credentials sign-in return type (redirect mode or manual redirect data). */
|
|
2619
|
+
type SignInCredentialsReturn<Options extends SignInCredentialsOptions> = Options extends {
|
|
2620
|
+
redirect: false;
|
|
2621
|
+
} ? Extract<SignInCredentialsReturnData, {
|
|
2622
|
+
redirect: false;
|
|
2623
|
+
}> : void;
|
|
2656
2624
|
/** Server/programmatic credentials sign-in options. */
|
|
2657
2625
|
interface SignInCredentialsAPIOptions extends APIOptionsWithRedirectTo, APIOptionsWithRequest {
|
|
2658
2626
|
/**
|
|
@@ -2666,83 +2634,73 @@ interface SignInCredentialsAPIOptions extends APIOptionsWithRedirectTo, APIOptio
|
|
|
2666
2634
|
payload: CredentialsPayload;
|
|
2667
2635
|
}
|
|
2668
2636
|
/** Programmatic credentials sign-in result with response metadata and `toResponse()`. */
|
|
2669
|
-
type SignInCredentialsAPIReturn = AuthActionAPIReturn<
|
|
2670
|
-
success: true;
|
|
2671
|
-
redirectURL: string;
|
|
2672
|
-
} | {
|
|
2673
|
-
success: false;
|
|
2674
|
-
redirectURL: null;
|
|
2675
|
-
}>;
|
|
2637
|
+
type SignInCredentialsAPIReturn = AuthActionAPIReturn<SignInCredentialsReturnData>;
|
|
2676
2638
|
/** Client-side sign-out options. */
|
|
2677
2639
|
interface SignOutOptions extends OptionsWithRedirectTo {}
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
redirect:
|
|
2681
|
-
|
|
2640
|
+
type SignOutReturnData = /** redirect: true & redirectTo: string */{
|
|
2641
|
+
success: true;
|
|
2642
|
+
redirect: true;
|
|
2643
|
+
redirectURL: null;
|
|
2644
|
+
} /** redirect: false & redirectTo: string */ | {
|
|
2682
2645
|
success: true;
|
|
2683
2646
|
redirect: false;
|
|
2684
2647
|
redirectURL: string;
|
|
2685
|
-
}
|
|
2648
|
+
}
|
|
2649
|
+
/** redirect: false & redirectTo: null | undefined (not set) */
|
|
2650
|
+
/** redirect: true & redirectTo: null | undefined (not set) */
|
|
2651
|
+
| {
|
|
2652
|
+
success: true;
|
|
2653
|
+
redirect: false;
|
|
2654
|
+
redirectURL: null;
|
|
2655
|
+
} /** Failed */ | {
|
|
2686
2656
|
success: false;
|
|
2687
2657
|
redirect: false;
|
|
2688
2658
|
redirectURL: null;
|
|
2689
|
-
}
|
|
2659
|
+
};
|
|
2660
|
+
/** Client-side sign-out return type (redirect mode or manual redirect data). */
|
|
2661
|
+
type SignOutReturn<Options extends SignOutOptions> = Options extends {
|
|
2662
|
+
redirect: false;
|
|
2663
|
+
} ? Extract<SignOutReturnData, {
|
|
2664
|
+
redirect: false;
|
|
2665
|
+
}> : void;
|
|
2690
2666
|
/** Server/programmatic options for `signOut` API. */
|
|
2691
|
-
interface SignOutAPIOptions extends
|
|
2692
|
-
/**
|
|
2693
|
-
* Required headers used to execute sign-out.
|
|
2694
|
-
* Must include `session_token` and `csrf_token` cookies for CSRF validation.
|
|
2695
|
-
* @example
|
|
2696
|
-
* {
|
|
2697
|
-
* Cookie: "session_token=abc123; csrf_token=def456"
|
|
2698
|
-
* }
|
|
2699
|
-
*/
|
|
2700
|
-
headers: HeadersInit;
|
|
2701
|
-
/**
|
|
2702
|
-
* Optional `Request` object as an alternative to manually providing `headers`.
|
|
2703
|
-
*/
|
|
2704
|
-
request?: Request;
|
|
2705
|
-
}
|
|
2667
|
+
interface SignOutAPIOptions extends RequiredKeys<APIOptionsWithRequest, "headers">, APIOptionsWithSkipCSRFCheck {}
|
|
2706
2668
|
/** Programmatic sign-out result with redirect metadata and `toResponse()`. */
|
|
2707
|
-
type SignOutAPIReturn = AuthActionAPIReturn<
|
|
2708
|
-
success: true;
|
|
2709
|
-
redirect: boolean;
|
|
2710
|
-
redirectURL: string;
|
|
2711
|
-
} | {
|
|
2712
|
-
success: false;
|
|
2713
|
-
redirect: boolean;
|
|
2714
|
-
redirectURL: null;
|
|
2715
|
-
}>;
|
|
2669
|
+
type SignOutAPIReturn = AuthActionAPIReturn<SignOutReturnData>;
|
|
2716
2670
|
/** Client-side `updateSession` options: partial session payload plus optional redirect behavior. */
|
|
2717
2671
|
interface UpdateSessionOptions<DefaultUser extends User = User> extends OptionsWithRedirectTo {
|
|
2718
2672
|
/** Partial session data to merge into the current session. */
|
|
2719
2673
|
session: DeepPartial<Session<DefaultUser>>;
|
|
2720
2674
|
}
|
|
2721
|
-
/**
|
|
2722
|
-
|
|
2675
|
+
type UpdateSessionReturnData<DefaultUser extends User = User> = /** redirect: true & redirectTo: string */{
|
|
2676
|
+
success: true;
|
|
2677
|
+
session: Session<DefaultUser>;
|
|
2678
|
+
redirect: true;
|
|
2679
|
+
redirectURL: null;
|
|
2680
|
+
} /** redirect: false & redirectTo: string */ | {
|
|
2681
|
+
success: true;
|
|
2682
|
+
session: Session<DefaultUser>;
|
|
2723
2683
|
redirect: false;
|
|
2724
|
-
|
|
2684
|
+
redirectURL: string;
|
|
2685
|
+
} /** redirect: false & redirectTo: null | undefined (not set) */ | {
|
|
2725
2686
|
success: true;
|
|
2726
2687
|
session: Session<DefaultUser>;
|
|
2727
|
-
|
|
2688
|
+
redirect: false;
|
|
2689
|
+
redirectURL: null;
|
|
2690
|
+
} /** Failed session update */ | {
|
|
2728
2691
|
success: false;
|
|
2729
2692
|
session: null;
|
|
2730
|
-
|
|
2693
|
+
redirect: false;
|
|
2694
|
+
redirectURL: null;
|
|
2695
|
+
};
|
|
2696
|
+
/** Client-side `updateSession` return type. */
|
|
2697
|
+
type UpdateSessionReturn<Options extends UpdateSessionOptions<DefaultUser>, DefaultUser extends User = User> = Options extends {
|
|
2698
|
+
redirect: false;
|
|
2699
|
+
} ? Extract<UpdateSessionReturnData<DefaultUser>, {
|
|
2700
|
+
redirect: false;
|
|
2701
|
+
}> : void;
|
|
2731
2702
|
/** Server/programmatic options for `updateSession` API. */
|
|
2732
|
-
interface UpdateSessionAPIOptions<DefaultUser extends User = User> extends APIOptionsWithRequest, APIOptionsWithSkipCSRFCheck {
|
|
2733
|
-
/**
|
|
2734
|
-
* Required headers used to execute session update.
|
|
2735
|
-
* Must include `session_token` and `csrf_token` cookies for CSRF validation.
|
|
2736
|
-
* @example
|
|
2737
|
-
* {
|
|
2738
|
-
* Cookie: "session_token=abc123; csrf_token=def456"
|
|
2739
|
-
* }
|
|
2740
|
-
*/
|
|
2741
|
-
headers: HeadersInit;
|
|
2742
|
-
/**
|
|
2743
|
-
* Optional `Request` object as an alternative to manually providing `headers`.
|
|
2744
|
-
*/
|
|
2745
|
-
request?: Request;
|
|
2703
|
+
interface UpdateSessionAPIOptions<DefaultUser extends User = User> extends RequiredKeys<APIOptionsWithRequest, "headers">, APIOptionsWithSkipCSRFCheck {
|
|
2746
2704
|
/**
|
|
2747
2705
|
* Partial session payload used to update the current session.
|
|
2748
2706
|
* @see Session
|
|
@@ -2757,15 +2715,7 @@ interface UpdateSessionAPIOptions<DefaultUser extends User = User> extends APIOp
|
|
|
2757
2715
|
session: DeepPartial<Session<DefaultUser>>;
|
|
2758
2716
|
}
|
|
2759
2717
|
/** Programmatic session update result with redirect metadata and `toResponse()`. */
|
|
2760
|
-
type UpdateSessionAPIReturn<DefaultUser extends User = User> = AuthActionAPIReturn<
|
|
2761
|
-
success: true;
|
|
2762
|
-
session: Session<DefaultUser>;
|
|
2763
|
-
redirectURL: string;
|
|
2764
|
-
} | {
|
|
2765
|
-
success: false;
|
|
2766
|
-
session: null;
|
|
2767
|
-
redirectURL: null;
|
|
2768
|
-
}>;
|
|
2718
|
+
type UpdateSessionAPIReturn<DefaultUser extends User = User> = AuthActionAPIReturn<UpdateSessionReturnData<DefaultUser>>;
|
|
2769
2719
|
//#endregion
|
|
2770
2720
|
//#region src/@types/index.d.ts
|
|
2771
2721
|
/**
|
|
@@ -2789,8 +2739,8 @@ type AuthClient = ReturnType<typeof createAuthInstance>["handlers"];
|
|
|
2789
2739
|
* Options for {@link createAuthClient} (browser HTTP client). Extends the router client with an optional `baseURL`
|
|
2790
2740
|
* when the client runs outside the browser (e.g. server-side fetch to your app origin).
|
|
2791
2741
|
*/
|
|
2792
|
-
type AuthClientOptions = Prettify
|
|
2742
|
+
type AuthClientOptions = Prettify<Omit<ClientOptions, "baseURL"> & {
|
|
2793
2743
|
baseURL?: string;
|
|
2794
2744
|
}>;
|
|
2795
2745
|
//#endregion
|
|
2796
|
-
export {
|
|
2746
|
+
export { FromShapeToObject as $, SpotifyProfile as $n, JWTEncryptionAlgorithm as $t, UpdateSessionOptions as A, Name as An, Logger as At, TokenRevocationError as B, twitch as Bn, OAuthProvider as Bt, SignOutAPIOptions as C, clickUp as Cn, UserShapeArkType as Cr, CredentialsProviderContext as Ct, SignOutReturnData as D, AccountType as Dn, InternalLogger as Dt, SignOutReturn as E, atlassian as En, createIdentity as Er, InternalContext as Et, AuthInternalErrorCode as F, NotionUser as Fn, StandardCookie as Ft, DeepPartial as G, mailchimp as Gn, AsymmetricKeyPair as Gt, ArktypeShapeToObject as H, pinterest as Hn, OAuthProviderCredentials as Ht, AuthSecurityErrorCode as I, Owner as In, SyslogOptions as It, EditableShapeArkType as J, SummaryGear as Jn, CryptoSecret as Jt, DeepRequired as K, StravaProfile as Kn, AsymmetricKeyPairFromEnv as Kt, AuthorizationError as L, Person as Ln, TrustedOrigin as Lt, UpdateSessionReturnData as M, dropbox as Mn, SchemaRegistryContext as Mt, APIErrorMap as N, Bot as Nn, SecureCookie as Nt, UpdateSessionAPIOptions as O, DropboxProfile as On, JoseInstance as Ot, AccessTokenError as P, NotionProfile as Pn, Severity as Pt, EditableUser as Q, SpotifyImage as Qn, JWTEncryptedMode as Qt, ErrorType as R, notion as Rn, TrustedProxyHeadersConfig as Rt, SignInReturn as S, ClickUpProfile as Sn, UserShape as Sr, CredentialsProvider as St, SignOutOptions as T, ExtendedProfile as Tn, UserShapeValibot as Tr, IdentityConfig as Tt, AuthResponse as U, Login as Un, OAuthProviderRecord as Ut, createAuth as V, PinterestProfile as Vn, OAuthProviderConfig as Vt, ConfigSchema as W, MailchimpProfile as Wn, ResponseType as Wt, EditableShapeValibot as X, XProfile as Xn, JWTConfig as Xt, EditableShapeTypebox as Y, strava as Yn, GetStatelessSessionReturn as Yt, EditableShapeZod as Z, x as Zn, JWTConfigBase as Zt, SignInCredentialsAPIReturn as _, createBuiltInOAuthProviders as _n, SchemaTypes as _r, CookieConfig as _t, OAuthEnv as a, JWTSealedMode as an, discord as ar, Prettify as at, SignInCredentialsReturnData as b, DribbbleTeams as bn, UserIdentityTypeBox as br, CookieStrategyAttributes as bt, APIOptionsWithRequest as c, JWTStrategyOptions as cn, BitbucketProfile as cr, TypeboxShapeToObject as ct, GetSessionAPIOptions as d, SessionConfig as dn, github as dr, Wrap as dt, JWTExpirationStrategy as en, spotify as er, InferSession as et, GetSessionAPIReturn as f, SessionStrategy as fn, createSyslogMessage as fr, ZodShapeToObject as ft, SignInCredentialsAPIOptions as g, builtInOAuthProviders as gn, IsZod as gr, AuthRuntimeConfig as gt, SignInAPIReturn as h, BuiltInOAuthProvider as hn, IsValibot as hr, AuthInstance as ht, JWTStandardClaims as i, JWTMode as in, Nameplate as ir, Merge as it, UpdateSessionReturn as j, RootInfo as jn, RouterGlobalContext as jt, UpdateSessionAPIReturn as k, FullTeam as kn, LogLevel as kt, APIOptionsWithSkipCSRFCheck as l, SecretKey as ln, bitbucket as lr, UserFrom as lt, SignInAPIOptions as m, User as mn, IsArkType as mr, AuthConfig as mt, AuthClientOptions as n, JWTKeyAlgorithm as nn, gitlab as nr, InferZodShape as nt, TypedJWTPayload$1 as o, JWTSignedMode as on, FigmaProfile as or, RequiredKeys as ot, OptionsWithRedirectTo as p, StatelessStrategyConfig as pn, Identities as pr, AuthAPI as pt, EditableShape as q, SummaryClub as qn, CreateSessionStrategyOptions as qt, JWTPayloadWithToken as r, JWTManager as rn, DiscordProfile as rr, LiteralUnion as rt, APIOptionsWithRedirectTo as s, JWTSigningAlgorithm as sn, figma as sr, SessionFrom as st, AuthClient as t, JWTKey as tn, GitLabProfile as tr, InferUser as tt, FunctionAPIContext as u, Session as un, GitHubProfile as ur, ValibotShapeToObject as ut, SignInCredentialsOptions as v, DribbbleDefault as vn, UserIdentity as vr, CookieName as vt, SignOutAPIReturn as w, AtlassianProfile as wn, UserShapeTypeBox as wr, HostCookie as wt, SignInOptions as x, dribbble as xn, UserIdentityValibot as xr, CredentialsPayload as xt, SignInCredentialsReturn as y, DribbbleProfile as yn, UserIdentityArkType as yr, CookieStoreConfig as yt, OAuthError as z, TwitchProfile as zn, AuthorizeParams as zt };
|