@auth/qwik 0.3.0 → 0.3.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/adapters.d.ts +2 -0
- package/adapters.d.ts.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.qwik.js +127 -0
- package/package.json +5 -2
- package/src/adapters.ts +1 -0
- package/src/index.ts +10 -0
package/adapters.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["src/adapters.ts"],"names":[],"mappings":"AAAA,mBAAmB,qBAAqB,CAAA"}
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Session } from '@auth/core/types';
|
|
|
3
3
|
import { z, RequestEventCommon } from '@builder.io/qwik-city';
|
|
4
4
|
import { EnvGetter } from '@builder.io/qwik-city/middleware/request-handler';
|
|
5
5
|
|
|
6
|
+
export { AuthError, CredentialsSignin } from '@auth/core/errors';
|
|
7
|
+
export type { Account, DefaultSession, Profile, Session, User, } from '@auth/core/types';
|
|
6
8
|
/** Configure the {@link QwikAuth$} method. */
|
|
7
9
|
export interface QwikAuthConfig extends Omit<AuthConfig, "raw"> {
|
|
8
10
|
}
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAc,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAGL,CAAC,EAED,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,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AE,OAAO,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,CAAC,CAAA;AA4G7E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,aArHE,kBAAkB,KAAK,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAuE7B,kBAAkB;CA8CmB,CAAA;AAmFrE,eAAO,MAAM,cAAc,QAAS,SAAS,UAAU,UAAU,SAwChE,CAAA"}
|
package/index.qwik.js
CHANGED
|
@@ -164,6 +164,131 @@ setCookie.exports = parse;
|
|
|
164
164
|
setCookie.exports.parse = parse;
|
|
165
165
|
var parseString_1 = setCookie.exports.parseString = parseString;
|
|
166
166
|
var splitCookiesString_1 = setCookie.exports.splitCookiesString = splitCookiesString;
|
|
167
|
+
class AuthError extends Error {
|
|
168
|
+
constructor(message, errorOptions) {
|
|
169
|
+
if (message instanceof Error) {
|
|
170
|
+
super(void 0, {
|
|
171
|
+
cause: { err: message, ...message.cause, ...errorOptions }
|
|
172
|
+
});
|
|
173
|
+
} else if (typeof message === "string") {
|
|
174
|
+
if (errorOptions instanceof Error) {
|
|
175
|
+
errorOptions = { err: errorOptions, ...errorOptions.cause };
|
|
176
|
+
}
|
|
177
|
+
super(message, errorOptions);
|
|
178
|
+
} else {
|
|
179
|
+
super(void 0, message);
|
|
180
|
+
}
|
|
181
|
+
this.name = this.constructor.name;
|
|
182
|
+
this.type = this.constructor.type ?? "AuthError";
|
|
183
|
+
this.kind = this.constructor.kind ?? "error";
|
|
184
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
185
|
+
const url = `https://errors.authjs.dev#${this.type.toLowerCase()}`;
|
|
186
|
+
this.message += `${this.message ? ". " : ""}Read more at ${url}`;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
class SignInError extends AuthError {
|
|
190
|
+
}
|
|
191
|
+
SignInError.kind = "signIn";
|
|
192
|
+
class AdapterError extends AuthError {
|
|
193
|
+
}
|
|
194
|
+
AdapterError.type = "AdapterError";
|
|
195
|
+
class AccessDenied extends AuthError {
|
|
196
|
+
}
|
|
197
|
+
AccessDenied.type = "AccessDenied";
|
|
198
|
+
class CallbackRouteError extends AuthError {
|
|
199
|
+
}
|
|
200
|
+
CallbackRouteError.type = "CallbackRouteError";
|
|
201
|
+
class ErrorPageLoop extends AuthError {
|
|
202
|
+
}
|
|
203
|
+
ErrorPageLoop.type = "ErrorPageLoop";
|
|
204
|
+
class EventError extends AuthError {
|
|
205
|
+
}
|
|
206
|
+
EventError.type = "EventError";
|
|
207
|
+
class InvalidCallbackUrl extends AuthError {
|
|
208
|
+
}
|
|
209
|
+
InvalidCallbackUrl.type = "InvalidCallbackUrl";
|
|
210
|
+
class CredentialsSignin extends SignInError {
|
|
211
|
+
constructor() {
|
|
212
|
+
super(...arguments);
|
|
213
|
+
this.code = "credentials";
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
CredentialsSignin.type = "CredentialsSignin";
|
|
217
|
+
class InvalidEndpoints extends AuthError {
|
|
218
|
+
}
|
|
219
|
+
InvalidEndpoints.type = "InvalidEndpoints";
|
|
220
|
+
class InvalidCheck extends AuthError {
|
|
221
|
+
}
|
|
222
|
+
InvalidCheck.type = "InvalidCheck";
|
|
223
|
+
class JWTSessionError extends AuthError {
|
|
224
|
+
}
|
|
225
|
+
JWTSessionError.type = "JWTSessionError";
|
|
226
|
+
class MissingAdapter extends AuthError {
|
|
227
|
+
}
|
|
228
|
+
MissingAdapter.type = "MissingAdapter";
|
|
229
|
+
class MissingAdapterMethods extends AuthError {
|
|
230
|
+
}
|
|
231
|
+
MissingAdapterMethods.type = "MissingAdapterMethods";
|
|
232
|
+
class MissingAuthorize extends AuthError {
|
|
233
|
+
}
|
|
234
|
+
MissingAuthorize.type = "MissingAuthorize";
|
|
235
|
+
class MissingSecret extends AuthError {
|
|
236
|
+
}
|
|
237
|
+
MissingSecret.type = "MissingSecret";
|
|
238
|
+
class OAuthAccountNotLinked extends SignInError {
|
|
239
|
+
}
|
|
240
|
+
OAuthAccountNotLinked.type = "OAuthAccountNotLinked";
|
|
241
|
+
class OAuthCallbackError extends SignInError {
|
|
242
|
+
}
|
|
243
|
+
OAuthCallbackError.type = "OAuthCallbackError";
|
|
244
|
+
class OAuthProfileParseError extends AuthError {
|
|
245
|
+
}
|
|
246
|
+
OAuthProfileParseError.type = "OAuthProfileParseError";
|
|
247
|
+
class SessionTokenError extends AuthError {
|
|
248
|
+
}
|
|
249
|
+
SessionTokenError.type = "SessionTokenError";
|
|
250
|
+
class OAuthSignInError extends SignInError {
|
|
251
|
+
}
|
|
252
|
+
OAuthSignInError.type = "OAuthSignInError";
|
|
253
|
+
class EmailSignInError extends SignInError {
|
|
254
|
+
}
|
|
255
|
+
EmailSignInError.type = "EmailSignInError";
|
|
256
|
+
class SignOutError extends AuthError {
|
|
257
|
+
}
|
|
258
|
+
SignOutError.type = "SignOutError";
|
|
259
|
+
class UnknownAction extends AuthError {
|
|
260
|
+
}
|
|
261
|
+
UnknownAction.type = "UnknownAction";
|
|
262
|
+
class UnsupportedStrategy extends AuthError {
|
|
263
|
+
}
|
|
264
|
+
UnsupportedStrategy.type = "UnsupportedStrategy";
|
|
265
|
+
class InvalidProvider extends AuthError {
|
|
266
|
+
}
|
|
267
|
+
InvalidProvider.type = "InvalidProvider";
|
|
268
|
+
class UntrustedHost extends AuthError {
|
|
269
|
+
}
|
|
270
|
+
UntrustedHost.type = "UntrustedHost";
|
|
271
|
+
class Verification extends AuthError {
|
|
272
|
+
}
|
|
273
|
+
Verification.type = "Verification";
|
|
274
|
+
class MissingCSRF extends SignInError {
|
|
275
|
+
}
|
|
276
|
+
MissingCSRF.type = "MissingCSRF";
|
|
277
|
+
class DuplicateConditionalUI extends AuthError {
|
|
278
|
+
}
|
|
279
|
+
DuplicateConditionalUI.type = "DuplicateConditionalUI";
|
|
280
|
+
class MissingWebAuthnAutocomplete extends AuthError {
|
|
281
|
+
}
|
|
282
|
+
MissingWebAuthnAutocomplete.type = "MissingWebAuthnAutocomplete";
|
|
283
|
+
class WebAuthnVerificationError extends AuthError {
|
|
284
|
+
}
|
|
285
|
+
WebAuthnVerificationError.type = "WebAuthnVerificationError";
|
|
286
|
+
class AccountNotLinked extends SignInError {
|
|
287
|
+
}
|
|
288
|
+
AccountNotLinked.type = "AccountNotLinked";
|
|
289
|
+
class ExperimentalFeatureNotEnabled extends AuthError {
|
|
290
|
+
}
|
|
291
|
+
ExperimentalFeatureNotEnabled.type = "ExperimentalFeatureNotEnabled";
|
|
167
292
|
function QwikAuthQrl(authOptions) {
|
|
168
293
|
const useSignIn = globalActionQrl(/* @__PURE__ */ inlinedQrl(async ({ providerId, redirectTo: _redirectTo, options, authorizationParams }, req) => {
|
|
169
294
|
const [authOptions2] = useLexicalScope();
|
|
@@ -345,6 +470,8 @@ const setEnvDefaults = (env, config) => {
|
|
|
345
470
|
});
|
|
346
471
|
};
|
|
347
472
|
export {
|
|
473
|
+
AuthError,
|
|
474
|
+
CredentialsSignin,
|
|
348
475
|
QwikAuth$,
|
|
349
476
|
QwikAuthQrl,
|
|
350
477
|
authAction as _auto_authAction,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auth/qwik",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Authentication for Qwik.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "gioboa <giorgiob.boa@gmail.com>",
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
"types": "./index.d.ts",
|
|
29
29
|
"import": "./index.qwik.js"
|
|
30
30
|
},
|
|
31
|
+
"./adapters": {
|
|
32
|
+
"types": "./adapters.d.ts"
|
|
33
|
+
},
|
|
31
34
|
"./providers": {
|
|
32
35
|
"types": "./providers/index.d.ts"
|
|
33
36
|
},
|
|
@@ -46,7 +49,7 @@
|
|
|
46
49
|
],
|
|
47
50
|
"dependencies": {
|
|
48
51
|
"set-cookie-parser": "^2.6.0",
|
|
49
|
-
"@auth/core": "0.35.
|
|
52
|
+
"@auth/core": "0.35.2"
|
|
50
53
|
},
|
|
51
54
|
"devDependencies": {
|
|
52
55
|
"@builder.io/qwik": "1.7.3",
|
package/src/adapters.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "@auth/core/adapters"
|
package/src/index.ts
CHANGED
|
@@ -124,6 +124,16 @@ import { EnvGetter } from "@builder.io/qwik-city/middleware/request-handler"
|
|
|
124
124
|
import { isServer } from "@builder.io/qwik/build"
|
|
125
125
|
import { parseString, splitCookiesString } from "set-cookie-parser"
|
|
126
126
|
|
|
127
|
+
export { AuthError, CredentialsSignin } from "@auth/core/errors"
|
|
128
|
+
|
|
129
|
+
export type {
|
|
130
|
+
Account,
|
|
131
|
+
DefaultSession,
|
|
132
|
+
Profile,
|
|
133
|
+
Session,
|
|
134
|
+
User,
|
|
135
|
+
} from "@auth/core/types"
|
|
136
|
+
|
|
127
137
|
/** Configure the {@link QwikAuth$} method. */
|
|
128
138
|
export interface QwikAuthConfig extends Omit<AuthConfig, "raw"> {}
|
|
129
139
|
|