@absolutejs/auth 0.26.0-beta.0 → 0.26.0-beta.1
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/credentials/config.d.ts +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export type CredentialsConfig<UserType> = {
|
|
|
23
23
|
getUserByEmail: (email: string) => Promise<UserType | null | undefined> | UserType | null | undefined;
|
|
24
24
|
isMfaRequired?: (user: UserType) => boolean | Promise<boolean>;
|
|
25
25
|
loginRoute?: RouteString;
|
|
26
|
-
onCreateCredentialUser: (identity: CredentialIdentity) => Promise<Response | StatusReturn | UserType> | Response | StatusReturn | UserType;
|
|
26
|
+
onCreateCredentialUser: (identity: CredentialIdentity & Record<string, unknown>) => Promise<Response | StatusReturn | UserType> | Response | StatusReturn | UserType;
|
|
27
27
|
onCredentialsLoginError?: (context: {
|
|
28
28
|
email: string;
|
|
29
29
|
error: unknown;
|
package/dist/index.js
CHANGED
|
@@ -2807,7 +2807,7 @@ var credentialsRegister = ({
|
|
|
2807
2807
|
sessionDurationMs = DEFAULT_CREDENTIAL_SESSION_TTL_MS,
|
|
2808
2808
|
verificationTokenDurationMs = DEFAULT_VERIFICATION_TOKEN_TTL_MS
|
|
2809
2809
|
}) => new Elysia5().use(sessionStore()).post(registerRoute, async ({
|
|
2810
|
-
body: { email, password },
|
|
2810
|
+
body: { email, password, ...extraFields },
|
|
2811
2811
|
cookie: { user_session_id },
|
|
2812
2812
|
status,
|
|
2813
2813
|
store: { session }
|
|
@@ -2828,6 +2828,7 @@ var credentialsRegister = ({
|
|
|
2828
2828
|
return status("Conflict", "Email is already registered");
|
|
2829
2829
|
}
|
|
2830
2830
|
const created = await onCreateCredentialUser({
|
|
2831
|
+
...extraFields,
|
|
2831
2832
|
email: normalizedEmail
|
|
2832
2833
|
});
|
|
2833
2834
|
if (created instanceof Response || isStatusResponse(created)) {
|
|
@@ -2872,7 +2873,7 @@ var credentialsRegister = ({
|
|
|
2872
2873
|
await onCredentialsLoginSuccess?.({ user: created, userSessionId });
|
|
2873
2874
|
return status("Created", { status: "authenticated" });
|
|
2874
2875
|
}, {
|
|
2875
|
-
body: t5.Object({ email: t5.String(), password: t5.String() }),
|
|
2876
|
+
body: t5.Object({ email: t5.String(), password: t5.String() }, { additionalProperties: true }),
|
|
2876
2877
|
cookie: t5.Cookie({ user_session_id: userSessionIdTypebox })
|
|
2877
2878
|
});
|
|
2878
2879
|
|
|
@@ -15436,5 +15437,5 @@ export {
|
|
|
15436
15437
|
AuthIdentityConflictError
|
|
15437
15438
|
};
|
|
15438
15439
|
|
|
15439
|
-
//# debugId=
|
|
15440
|
+
//# debugId=B747E5842F47E36264756E2164756E21
|
|
15440
15441
|
//# sourceMappingURL=index.js.map
|