vinextauth 0.1.0 → 0.2.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/adapters/cloudflare-kv.d.ts +1 -1
- package/dist/index.d.ts +41 -6
- package/dist/index.js +378 -68
- package/dist/index.js.map +1 -1
- package/dist/middleware/index.d.ts +1 -1
- package/dist/providers/credentials.d.ts +38 -0
- package/dist/providers/credentials.js +15 -0
- package/dist/providers/credentials.js.map +1 -0
- package/dist/providers/github.d.ts +1 -1
- package/dist/providers/google.d.ts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/server/index.d.ts +32 -12
- package/dist/server/index.js +136 -8
- package/dist/server/index.js.map +1 -1
- package/dist/types-Bsno2U1C.d.ts +270 -0
- package/package.json +5 -1
- package/dist/types-G_m6Z3Iz.d.ts +0 -180
package/dist/types-G_m6Z3Iz.d.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
interface User {
|
|
2
|
-
id: string;
|
|
3
|
-
name?: string | null;
|
|
4
|
-
email?: string | null;
|
|
5
|
-
image?: string | null;
|
|
6
|
-
}
|
|
7
|
-
interface Session {
|
|
8
|
-
user: User;
|
|
9
|
-
expires: string;
|
|
10
|
-
}
|
|
11
|
-
interface JWT {
|
|
12
|
-
sub?: string;
|
|
13
|
-
name?: string | null;
|
|
14
|
-
email?: string | null;
|
|
15
|
-
picture?: string | null;
|
|
16
|
-
iat?: number;
|
|
17
|
-
exp?: number;
|
|
18
|
-
jti?: string;
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
}
|
|
21
|
-
interface OAuthProvider {
|
|
22
|
-
id: string;
|
|
23
|
-
name: string;
|
|
24
|
-
type: "oauth";
|
|
25
|
-
clientId: string;
|
|
26
|
-
clientSecret: string;
|
|
27
|
-
authorization: {
|
|
28
|
-
url: string;
|
|
29
|
-
params?: Record<string, string>;
|
|
30
|
-
};
|
|
31
|
-
token: {
|
|
32
|
-
url: string;
|
|
33
|
-
};
|
|
34
|
-
userinfo: {
|
|
35
|
-
url: string;
|
|
36
|
-
};
|
|
37
|
-
profile(profile: Record<string, unknown>): User;
|
|
38
|
-
checks?: Array<"state" | "pkce" | "none">;
|
|
39
|
-
scope?: string;
|
|
40
|
-
}
|
|
41
|
-
interface AdapterSession {
|
|
42
|
-
sessionToken: string;
|
|
43
|
-
userId: string;
|
|
44
|
-
expires: Date;
|
|
45
|
-
}
|
|
46
|
-
interface AdapterInterface {
|
|
47
|
-
getSession(sessionToken: string): Promise<(AdapterSession & {
|
|
48
|
-
user: User;
|
|
49
|
-
}) | null>;
|
|
50
|
-
createSession(session: AdapterSession): Promise<AdapterSession>;
|
|
51
|
-
updateSession(session: Partial<AdapterSession> & {
|
|
52
|
-
sessionToken: string;
|
|
53
|
-
}): Promise<AdapterSession | null>;
|
|
54
|
-
deleteSession(sessionToken: string): Promise<void>;
|
|
55
|
-
}
|
|
56
|
-
interface SignInCallbackParams {
|
|
57
|
-
user: User;
|
|
58
|
-
account: {
|
|
59
|
-
provider: string;
|
|
60
|
-
type: string;
|
|
61
|
-
providerAccountId: string;
|
|
62
|
-
access_token?: string;
|
|
63
|
-
refresh_token?: string;
|
|
64
|
-
expires_at?: number;
|
|
65
|
-
token_type?: string;
|
|
66
|
-
scope?: string;
|
|
67
|
-
id_token?: string;
|
|
68
|
-
} | null;
|
|
69
|
-
profile?: Record<string, unknown>;
|
|
70
|
-
}
|
|
71
|
-
interface SessionCallbackParams {
|
|
72
|
-
session: Session;
|
|
73
|
-
token: JWT;
|
|
74
|
-
user?: User;
|
|
75
|
-
}
|
|
76
|
-
interface JWTCallbackParams {
|
|
77
|
-
token: JWT;
|
|
78
|
-
user?: User;
|
|
79
|
-
account?: SignInCallbackParams["account"];
|
|
80
|
-
profile?: Record<string, unknown>;
|
|
81
|
-
trigger?: "signIn" | "signUp" | "update";
|
|
82
|
-
isNewUser?: boolean;
|
|
83
|
-
session?: Session;
|
|
84
|
-
}
|
|
85
|
-
interface CallbacksConfig {
|
|
86
|
-
signIn?: (params: SignInCallbackParams) => Promise<boolean | string> | boolean | string;
|
|
87
|
-
session?: (params: SessionCallbackParams) => Promise<Session> | Session;
|
|
88
|
-
jwt?: (params: JWTCallbackParams) => Promise<JWT> | JWT;
|
|
89
|
-
redirect?: (params: {
|
|
90
|
-
url: string;
|
|
91
|
-
baseUrl: string;
|
|
92
|
-
}) => Promise<string> | string;
|
|
93
|
-
}
|
|
94
|
-
interface PagesConfig {
|
|
95
|
-
signIn?: string;
|
|
96
|
-
signOut?: string;
|
|
97
|
-
error?: string;
|
|
98
|
-
verifyRequest?: string;
|
|
99
|
-
newUser?: string;
|
|
100
|
-
}
|
|
101
|
-
interface SessionConfig {
|
|
102
|
-
strategy?: "jwt" | "database";
|
|
103
|
-
maxAge?: number;
|
|
104
|
-
updateAge?: number;
|
|
105
|
-
}
|
|
106
|
-
interface JWTConfig {
|
|
107
|
-
secret?: string;
|
|
108
|
-
maxAge?: number;
|
|
109
|
-
encode?: (params: {
|
|
110
|
-
token: JWT;
|
|
111
|
-
secret: string;
|
|
112
|
-
maxAge: number;
|
|
113
|
-
}) => Promise<string>;
|
|
114
|
-
decode?: (params: {
|
|
115
|
-
token: string;
|
|
116
|
-
secret: string;
|
|
117
|
-
}) => Promise<JWT | null>;
|
|
118
|
-
}
|
|
119
|
-
interface VinextAuthConfig {
|
|
120
|
-
providers: OAuthProvider[];
|
|
121
|
-
secret?: string;
|
|
122
|
-
callbacks?: CallbacksConfig;
|
|
123
|
-
pages?: PagesConfig;
|
|
124
|
-
session?: SessionConfig;
|
|
125
|
-
jwt?: JWTConfig;
|
|
126
|
-
adapter?: AdapterInterface;
|
|
127
|
-
debug?: boolean;
|
|
128
|
-
useSecureCookies?: boolean;
|
|
129
|
-
cookies?: Partial<CookiesConfig>;
|
|
130
|
-
}
|
|
131
|
-
interface CookieOption {
|
|
132
|
-
name: string;
|
|
133
|
-
options: {
|
|
134
|
-
httpOnly?: boolean;
|
|
135
|
-
sameSite?: "lax" | "strict" | "none";
|
|
136
|
-
path?: string;
|
|
137
|
-
secure?: boolean;
|
|
138
|
-
maxAge?: number;
|
|
139
|
-
domain?: string;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
interface CookiesConfig {
|
|
143
|
-
sessionToken: CookieOption;
|
|
144
|
-
callbackUrl: CookieOption;
|
|
145
|
-
csrfToken: CookieOption;
|
|
146
|
-
state: CookieOption;
|
|
147
|
-
nonce: CookieOption;
|
|
148
|
-
}
|
|
149
|
-
interface VinextAuthHandlers {
|
|
150
|
-
GET: (request: Request) => Promise<Response>;
|
|
151
|
-
POST: (request: Request) => Promise<Response>;
|
|
152
|
-
}
|
|
153
|
-
type SessionStatus = "loading" | "authenticated" | "unauthenticated";
|
|
154
|
-
interface SessionContextValue {
|
|
155
|
-
data: Session | null;
|
|
156
|
-
status: SessionStatus;
|
|
157
|
-
update: (data?: Partial<Session>) => Promise<Session | null>;
|
|
158
|
-
}
|
|
159
|
-
interface SignInOptions {
|
|
160
|
-
callbackUrl?: string;
|
|
161
|
-
redirect?: boolean;
|
|
162
|
-
}
|
|
163
|
-
interface SignOutOptions {
|
|
164
|
-
callbackUrl?: string;
|
|
165
|
-
redirect?: boolean;
|
|
166
|
-
}
|
|
167
|
-
interface WithAuthOptions {
|
|
168
|
-
pages?: {
|
|
169
|
-
signIn?: string;
|
|
170
|
-
};
|
|
171
|
-
callbacks?: {
|
|
172
|
-
authorized?: (params: {
|
|
173
|
-
token: JWT | null;
|
|
174
|
-
req: Request;
|
|
175
|
-
}) => boolean | Promise<boolean>;
|
|
176
|
-
};
|
|
177
|
-
secret?: string;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export type { AdapterInterface as A, CallbacksConfig as C, JWT as J, OAuthProvider as O, PagesConfig as P, Session as S, User as U, VinextAuthConfig as V, WithAuthOptions as W, VinextAuthHandlers as a, AdapterSession as b, JWTCallbackParams as c, JWTConfig as d, SessionCallbackParams as e, SessionConfig as f, SessionContextValue as g, SessionStatus as h, SignInCallbackParams as i, SignInOptions as j, SignOutOptions as k };
|