@better-auth-ui/solid 1.6.19
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/components/auth/email/email-changed.d.ts +59 -0
- package/dist/components/auth/email/email-changed.js +264 -0
- package/dist/components/auth/email/email-styles.d.ts +48 -0
- package/dist/components/auth/email/email-styles.js +107 -0
- package/dist/components/auth/email/email-verification.d.ts +51 -0
- package/dist/components/auth/email/email-verification.js +212 -0
- package/dist/components/auth/email/index.d.ts +9 -0
- package/dist/components/auth/email/magic-link.d.ts +53 -0
- package/dist/components/auth/email/magic-link.js +213 -0
- package/dist/components/auth/email/new-device.d.ts +77 -0
- package/dist/components/auth/email/new-device.js +326 -0
- package/dist/components/auth/email/organization-invitation.d.ts +70 -0
- package/dist/components/auth/email/organization-invitation.js +260 -0
- package/dist/components/auth/email/otp-email.d.ts +49 -0
- package/dist/components/auth/email/otp-email.js +191 -0
- package/dist/components/auth/email/password-changed.d.ts +56 -0
- package/dist/components/auth/email/password-changed.js +236 -0
- package/dist/components/auth/email/reset-password.d.ts +51 -0
- package/dist/components/auth/email/reset-password.js +212 -0
- package/dist/email.d.ts +18 -0
- package/dist/email.js +10 -0
- package/dist/hooks/auth/use-authenticate.d.ts +3 -0
- package/dist/hooks/auth/use-authenticate.js +18 -0
- package/dist/hooks/auth/use-sign-out.d.ts +2 -0
- package/dist/hooks/auth/use-sign-out.js +17 -0
- package/dist/hooks/auth/use-user.d.ts +213 -0
- package/dist/hooks/auth/use-user.js +13 -0
- package/dist/hooks/use-auth-mutation.d.ts +6 -0
- package/dist/hooks/use-auth-mutation.js +11 -0
- package/dist/hooks/use-auth-query.d.ts +5 -0
- package/dist/hooks/use-auth-query.js +17 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +68 -0
- package/dist/lib/auth-client.d.ts +26 -0
- package/dist/lib/auth-config.d.ts +12 -0
- package/dist/lib/auth-config.js +21 -0
- package/dist/lib/auth-plugin.d.ts +16 -0
- package/dist/lib/auth-provider.d.ts +12 -0
- package/dist/lib/auth-provider.js +36 -0
- package/dist/lib/auth-server.d.ts +16 -0
- package/dist/lib/auth-utils.d.ts +3 -0
- package/dist/lib/auth-utils.js +12 -0
- package/dist/lib/fetch-options-provider.d.ts +23 -0
- package/dist/lib/fetch-options-provider.js +29 -0
- package/dist/lib/mutation-invalidator.d.ts +11 -0
- package/dist/lib/mutation-invalidator.js +20 -0
- package/dist/lib/provider-icons.d.ts +8 -0
- package/dist/lib/provider-icons.js +5 -0
- package/dist/mutations/api-key/create-api-key-mutation.d.ts +71 -0
- package/dist/mutations/api-key/create-api-key-mutation.js +12 -0
- package/dist/mutations/api-key/delete-api-key-mutation.d.ts +23 -0
- package/dist/mutations/api-key/delete-api-key-mutation.js +12 -0
- package/dist/mutations/auth/request-password-reset-mutation.d.ts +11 -0
- package/dist/mutations/auth/request-password-reset-mutation.js +8 -0
- package/dist/mutations/auth/reset-password-mutation.d.ts +13 -0
- package/dist/mutations/auth/reset-password-mutation.js +8 -0
- package/dist/mutations/auth/send-verification-email-mutation.d.ts +11 -0
- package/dist/mutations/auth/send-verification-email-mutation.js +8 -0
- package/dist/mutations/auth/sign-in-email-mutation.d.ts +15 -0
- package/dist/mutations/auth/sign-in-email-mutation.js +8 -0
- package/dist/mutations/auth/sign-in-social-mutation.d.ts +53 -0
- package/dist/mutations/auth/sign-in-social-mutation.js +8 -0
- package/dist/mutations/auth/sign-out-mutation.d.ts +6 -0
- package/dist/mutations/auth/sign-out-mutation.js +8 -0
- package/dist/mutations/auth/sign-up-email-mutation.d.ts +17 -0
- package/dist/mutations/auth/sign-up-email-mutation.js +8 -0
- package/dist/mutations/auth-mutation-options.d.ts +10 -0
- package/dist/mutations/auth-mutation-options.js +19 -0
- package/dist/mutations/create-auth-mutation.d.ts +10 -0
- package/dist/mutations/create-auth-mutation.js +20 -0
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +19 -0
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +8 -0
- package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +19 -0
- package/dist/mutations/multi-session/revoke-multi-session-mutation.js +12 -0
- package/dist/mutations/multi-session/set-active-session-mutation.d.ts +19 -0
- package/dist/mutations/multi-session/set-active-session-mutation.js +13 -0
- package/dist/mutations/organization/accept-invitation-mutation.d.ts +18 -0
- package/dist/mutations/organization/accept-invitation-mutation.js +12 -0
- package/dist/mutations/organization/cancel-invitation-mutation.d.ts +18 -0
- package/dist/mutations/organization/cancel-invitation-mutation.js +12 -0
- package/dist/mutations/organization/check-slug-mutation.d.ts +18 -0
- package/dist/mutations/organization/check-slug-mutation.js +15 -0
- package/dist/mutations/organization/create-organization-mutation.d.ts +38 -0
- package/dist/mutations/organization/create-organization-mutation.js +12 -0
- package/dist/mutations/organization/delete-organization-mutation.d.ts +18 -0
- package/dist/mutations/organization/delete-organization-mutation.js +12 -0
- package/dist/mutations/organization/index.d.ts +13 -0
- package/dist/mutations/organization/index.js +13 -0
- package/dist/mutations/organization/invite-member-mutation.d.ts +30 -0
- package/dist/mutations/organization/invite-member-mutation.js +12 -0
- package/dist/mutations/organization/leave-organization-mutation.d.ts +18 -0
- package/dist/mutations/organization/leave-organization-mutation.js +12 -0
- package/dist/mutations/organization/metadata.d.ts +13 -0
- package/dist/mutations/organization/metadata.js +27 -0
- package/dist/mutations/organization/reject-invitation-mutation.d.ts +18 -0
- package/dist/mutations/organization/reject-invitation-mutation.js +12 -0
- package/dist/mutations/organization/remove-member-mutation.d.ts +22 -0
- package/dist/mutations/organization/remove-member-mutation.js +12 -0
- package/dist/mutations/organization/set-active-organization-mutation.d.ts +24 -0
- package/dist/mutations/organization/set-active-organization-mutation.js +35 -0
- package/dist/mutations/organization/update-member-role-mutation.d.ts +26 -0
- package/dist/mutations/organization/update-member-role-mutation.js +12 -0
- package/dist/mutations/organization/update-organization-mutation.d.ts +42 -0
- package/dist/mutations/organization/update-organization-mutation.js +12 -0
- package/dist/mutations/organization/utils.d.ts +8 -0
- package/dist/mutations/organization/utils.js +17 -0
- package/dist/mutations/passkey/add-passkey-mutation.d.ts +73 -0
- package/dist/mutations/passkey/add-passkey-mutation.js +12 -0
- package/dist/mutations/passkey/delete-passkey-mutation.d.ts +19 -0
- package/dist/mutations/passkey/delete-passkey-mutation.js +12 -0
- package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +50 -0
- package/dist/mutations/passkey/sign-in-passkey-mutation.js +9 -0
- package/dist/mutations/settings/change-email-mutation.d.ts +11 -0
- package/dist/mutations/settings/change-email-mutation.js +8 -0
- package/dist/mutations/settings/change-password-mutation.d.ts +13 -0
- package/dist/mutations/settings/change-password-mutation.js +8 -0
- package/dist/mutations/settings/delete-user-mutation.d.ts +13 -0
- package/dist/mutations/settings/delete-user-mutation.js +8 -0
- package/dist/mutations/settings/link-social-mutation.d.ts +35 -0
- package/dist/mutations/settings/link-social-mutation.js +8 -0
- package/dist/mutations/settings/revoke-session-mutation.d.ts +19 -0
- package/dist/mutations/settings/revoke-session-mutation.js +12 -0
- package/dist/mutations/settings/unlink-account-mutation.d.ts +23 -0
- package/dist/mutations/settings/unlink-account-mutation.js +12 -0
- package/dist/mutations/settings/update-user-mutation.d.ts +6 -0
- package/dist/mutations/settings/update-user-mutation.js +8 -0
- package/dist/mutations/use-session-scoped-mutation.d.ts +17 -0
- package/dist/mutations/use-session-scoped-mutation.js +17 -0
- package/dist/mutations/username/is-username-available-mutation.d.ts +9 -0
- package/dist/mutations/username/is-username-available-mutation.js +8 -0
- package/dist/mutations/username/sign-in-username-mutation.d.ts +15 -0
- package/dist/mutations/username/sign-in-username-mutation.js +9 -0
- package/dist/plugins/captcha-plugin.d.ts +29 -0
- package/dist/plugins/captcha-plugin.js +26 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/plugins.js +2 -0
- package/dist/queries/api-key/list-api-keys-query.d.ts +44 -0
- package/dist/queries/api-key/list-api-keys-query.js +17 -0
- package/dist/queries/auth/session-query.d.ts +22 -0
- package/dist/queries/auth/session-query.js +32 -0
- package/dist/queries/auth-query-options.d.ts +14 -0
- package/dist/queries/auth-query-options.js +17 -0
- package/dist/queries/create-user-scoped-query.d.ts +25 -0
- package/dist/queries/create-user-scoped-query.js +29 -0
- package/dist/queries/multi-session/list-device-sessions-query.d.ts +23 -0
- package/dist/queries/multi-session/list-device-sessions-query.js +17 -0
- package/dist/queries/organization/active-organization-query.d.ts +37 -0
- package/dist/queries/organization/active-organization-query.js +26 -0
- package/dist/queries/organization/full-organization-query.d.ts +35 -0
- package/dist/queries/organization/full-organization-query.js +25 -0
- package/dist/queries/organization/has-permission-query.d.ts +23 -0
- package/dist/queries/organization/has-permission-query.js +31 -0
- package/dist/queries/organization/index.d.ts +7 -0
- package/dist/queries/organization/index.js +7 -0
- package/dist/queries/organization/list-invitations-query.d.ts +29 -0
- package/dist/queries/organization/list-invitations-query.js +29 -0
- package/dist/queries/organization/list-members-query.d.ts +53 -0
- package/dist/queries/organization/list-members-query.js +29 -0
- package/dist/queries/organization/list-organizations-query.d.ts +23 -0
- package/dist/queries/organization/list-organizations-query.js +25 -0
- package/dist/queries/organization/list-user-invitations-query.d.ts +29 -0
- package/dist/queries/organization/list-user-invitations-query.js +25 -0
- package/dist/queries/organization/plugin.d.ts +1 -0
- package/dist/queries/organization/plugin.js +8 -0
- package/dist/queries/organization/utils.d.ts +16 -0
- package/dist/queries/organization/utils.js +18 -0
- package/dist/queries/passkey/list-passkeys-query.d.ts +23 -0
- package/dist/queries/passkey/list-passkeys-query.js +17 -0
- package/dist/queries/settings/account-info-query.d.ts +35 -0
- package/dist/queries/settings/account-info-query.js +17 -0
- package/dist/queries/settings/list-accounts-query.d.ts +23 -0
- package/dist/queries/settings/list-accounts-query.js +17 -0
- package/dist/queries/settings/list-sessions-query.d.ts +24 -0
- package/dist/queries/settings/list-sessions-query.js +17 -0
- package/dist/server/queries/auth/session-query.d.ts +19 -0
- package/dist/server/queries/auth/session-query.js +13 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +7 -0
- package/package.json +63 -0
- package/src/components/auth/email/email-changed.tsx +305 -0
- package/src/components/auth/email/email-styles.tsx +139 -0
- package/src/components/auth/email/email-verification.tsx +249 -0
- package/src/components/auth/email/index.ts +9 -0
- package/src/components/auth/email/magic-link.tsx +254 -0
- package/src/components/auth/email/new-device.tsx +347 -0
- package/src/components/auth/email/organization-invitation.tsx +322 -0
- package/src/components/auth/email/otp-email.tsx +239 -0
- package/src/components/auth/email/password-changed.tsx +279 -0
- package/src/components/auth/email/reset-password.tsx +250 -0
- package/src/email.ts +49 -0
- package/src/hooks/auth/use-authenticate.ts +30 -0
- package/src/hooks/auth/use-sign-out.ts +23 -0
- package/src/hooks/auth/use-user.ts +19 -0
- package/src/hooks/use-auth-mutation.ts +35 -0
- package/src/hooks/use-auth-query.ts +33 -0
- package/src/index.ts +48 -0
- package/src/lib/auth-client.ts +43 -0
- package/src/lib/auth-config.ts +46 -0
- package/src/lib/auth-plugin.ts +20 -0
- package/src/lib/auth-provider.tsx +60 -0
- package/src/lib/auth-server.ts +25 -0
- package/src/lib/auth-utils.ts +25 -0
- package/src/lib/fetch-options-provider.tsx +77 -0
- package/src/lib/mutation-invalidator.tsx +82 -0
- package/src/lib/provider-icons.ts +10 -0
- package/src/mutations/api-key/create-api-key-mutation.ts +40 -0
- package/src/mutations/api-key/delete-api-key-mutation.ts +40 -0
- package/src/mutations/auth/request-password-reset-mutation.ts +15 -0
- package/src/mutations/auth/reset-password-mutation.ts +16 -0
- package/src/mutations/auth/send-verification-email-mutation.ts +15 -0
- package/src/mutations/auth/sign-in-email-mutation.ts +17 -0
- package/src/mutations/auth/sign-in-social-mutation.ts +16 -0
- package/src/mutations/auth/sign-out-mutation.ts +13 -0
- package/src/mutations/auth/sign-up-email-mutation.ts +17 -0
- package/src/mutations/auth-mutation-options.ts +62 -0
- package/src/mutations/create-auth-mutation.ts +44 -0
- package/src/mutations/magic-link/sign-in-magic-link-mutation.ts +15 -0
- package/src/mutations/multi-session/revoke-multi-session-mutation.ts +40 -0
- package/src/mutations/multi-session/set-active-session-mutation.ts +43 -0
- package/src/mutations/organization/accept-invitation-mutation.ts +38 -0
- package/src/mutations/organization/cancel-invitation-mutation.ts +38 -0
- package/src/mutations/organization/check-slug-mutation.ts +36 -0
- package/src/mutations/organization/create-organization-mutation.ts +37 -0
- package/src/mutations/organization/delete-organization-mutation.ts +37 -0
- package/src/mutations/organization/index.ts +13 -0
- package/src/mutations/organization/invite-member-mutation.ts +38 -0
- package/src/mutations/organization/leave-organization-mutation.ts +37 -0
- package/src/mutations/organization/metadata.ts +103 -0
- package/src/mutations/organization/reject-invitation-mutation.ts +38 -0
- package/src/mutations/organization/remove-member-mutation.ts +38 -0
- package/src/mutations/organization/set-active-organization-mutation.ts +110 -0
- package/src/mutations/organization/update-member-role-mutation.ts +38 -0
- package/src/mutations/organization/update-organization-mutation.ts +37 -0
- package/src/mutations/organization/utils.ts +51 -0
- package/src/mutations/passkey/add-passkey-mutation.ts +40 -0
- package/src/mutations/passkey/delete-passkey-mutation.ts +40 -0
- package/src/mutations/passkey/sign-in-passkey-mutation.ts +17 -0
- package/src/mutations/settings/change-email-mutation.ts +17 -0
- package/src/mutations/settings/change-password-mutation.ts +16 -0
- package/src/mutations/settings/delete-user-mutation.ts +16 -0
- package/src/mutations/settings/link-social-mutation.ts +16 -0
- package/src/mutations/settings/revoke-session-mutation.ts +38 -0
- package/src/mutations/settings/unlink-account-mutation.ts +38 -0
- package/src/mutations/settings/update-user-mutation.ts +17 -0
- package/src/mutations/use-session-scoped-mutation.ts +64 -0
- package/src/mutations/username/is-username-available-mutation.ts +15 -0
- package/src/mutations/username/sign-in-username-mutation.ts +17 -0
- package/src/plugins/captcha-plugin.tsx +64 -0
- package/src/plugins.ts +2 -0
- package/src/queries/api-key/list-api-keys-query.ts +93 -0
- package/src/queries/auth/session-query.ts +81 -0
- package/src/queries/auth-query-options.ts +57 -0
- package/src/queries/create-user-scoped-query.ts +107 -0
- package/src/queries/multi-session/list-device-sessions-query.ts +107 -0
- package/src/queries/organization/active-organization-query.ts +127 -0
- package/src/queries/organization/full-organization-query.ts +111 -0
- package/src/queries/organization/has-permission-query.ts +121 -0
- package/src/queries/organization/index.ts +7 -0
- package/src/queries/organization/list-invitations-query.ts +124 -0
- package/src/queries/organization/list-members-query.ts +124 -0
- package/src/queries/organization/list-organizations-query.ts +113 -0
- package/src/queries/organization/list-user-invitations-query.ts +114 -0
- package/src/queries/organization/plugin.ts +11 -0
- package/src/queries/organization/utils.ts +88 -0
- package/src/queries/passkey/list-passkeys-query.ts +93 -0
- package/src/queries/settings/account-info-query.ts +94 -0
- package/src/queries/settings/list-accounts-query.ts +94 -0
- package/src/queries/settings/list-sessions-query.ts +96 -0
- package/src/server/queries/auth/session-query.ts +56 -0
- package/src/server.ts +7 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import e from "./email-styles.js";
|
|
2
|
+
import { createComponent as t, ssr as n } from "solid-js/web";
|
|
3
|
+
import { Body as r, Button as i, Container as a, Head as o, Heading as s, Hr as c, Html as l, Img as u, Link as d, Preview as f, Section as p, Tailwind as m, Text as h } from "@solidjs-email/main";
|
|
4
|
+
import { Show as g } from "solid-js";
|
|
5
|
+
//#region src/components/auth/email/reset-password.tsx
|
|
6
|
+
var _ = "<meta content=\"light dark\" name=\"color-scheme\">", v = "<meta content=\"light dark\" name=\"supported-color-schemes\">";
|
|
7
|
+
function y(...e) {
|
|
8
|
+
return e.filter(Boolean).join(" ");
|
|
9
|
+
}
|
|
10
|
+
var b = {
|
|
11
|
+
RESET_YOUR_PASSWORD: "Reset your password",
|
|
12
|
+
LOGO: "Logo",
|
|
13
|
+
WE_RECEIVED_REQUEST_TO_RESET_PASSWORD: "We received a request to reset the password for your {appName} account {email}.",
|
|
14
|
+
RESET_PASSWORD: "Reset password",
|
|
15
|
+
OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
|
|
16
|
+
THIS_LINK_EXPIRES_IN_MINUTES: "This link expires in {expirationMinutes} minutes.",
|
|
17
|
+
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
18
|
+
IF_YOU_DIDNT_REQUEST_PASSWORD_RESET: "If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.",
|
|
19
|
+
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
20
|
+
};
|
|
21
|
+
function x(e) {
|
|
22
|
+
return e.replace(/\s{2,}/g, " ").replace(" .", ".");
|
|
23
|
+
}
|
|
24
|
+
function S(b) {
|
|
25
|
+
let C = () => b.expirationMinutes ?? 60, w = () => b.darkMode ?? !0, T = () => ({
|
|
26
|
+
...S.localization,
|
|
27
|
+
...b.localization
|
|
28
|
+
}), E = () => x(T().WE_RECEIVED_REQUEST_TO_RESET_PASSWORD.replace("{appName}", b.appName || "").replace("{email}", b.email || ""));
|
|
29
|
+
return t(l, { get children() {
|
|
30
|
+
return [
|
|
31
|
+
t(o, { get children() {
|
|
32
|
+
return [
|
|
33
|
+
n(_),
|
|
34
|
+
n(v),
|
|
35
|
+
t(e, {
|
|
36
|
+
get colors() {
|
|
37
|
+
return b.colors;
|
|
38
|
+
},
|
|
39
|
+
get darkMode() {
|
|
40
|
+
return w();
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
b.head
|
|
44
|
+
];
|
|
45
|
+
} }),
|
|
46
|
+
t(f, { get children() {
|
|
47
|
+
return T().RESET_YOUR_PASSWORD;
|
|
48
|
+
} }),
|
|
49
|
+
t(m, { get children() {
|
|
50
|
+
return t(r, {
|
|
51
|
+
get class() {
|
|
52
|
+
return y("bg-background", b.classNames?.body);
|
|
53
|
+
},
|
|
54
|
+
style: { "font-family": "Arial, Helvetica, sans-serif" },
|
|
55
|
+
get children() {
|
|
56
|
+
return t(a, {
|
|
57
|
+
get class() {
|
|
58
|
+
return y("mx-auto my-auto max-w-xl px-2 py-10", b.classNames?.container);
|
|
59
|
+
},
|
|
60
|
+
get children() {
|
|
61
|
+
return t(p, {
|
|
62
|
+
get class() {
|
|
63
|
+
return y("rounded-none border border-border bg-card p-8 text-card-foreground", b.classNames?.card);
|
|
64
|
+
},
|
|
65
|
+
get children() {
|
|
66
|
+
return [
|
|
67
|
+
b.logoURL && (typeof b.logoURL == "string" ? t(u, {
|
|
68
|
+
get alt() {
|
|
69
|
+
return b.appName || T().LOGO;
|
|
70
|
+
},
|
|
71
|
+
get class() {
|
|
72
|
+
return y("mx-auto mb-8", b.classNames?.logo);
|
|
73
|
+
},
|
|
74
|
+
height: 48,
|
|
75
|
+
get src() {
|
|
76
|
+
return b.logoURL;
|
|
77
|
+
},
|
|
78
|
+
width: 48
|
|
79
|
+
}) : [t(u, {
|
|
80
|
+
get alt() {
|
|
81
|
+
return b.appName || T().LOGO;
|
|
82
|
+
},
|
|
83
|
+
get class() {
|
|
84
|
+
return y("logo-light mx-auto mb-8", b.classNames?.logo);
|
|
85
|
+
},
|
|
86
|
+
height: 48,
|
|
87
|
+
get src() {
|
|
88
|
+
return b.logoURL.light;
|
|
89
|
+
},
|
|
90
|
+
width: 48
|
|
91
|
+
}), t(u, {
|
|
92
|
+
get alt() {
|
|
93
|
+
return b.appName || T().LOGO;
|
|
94
|
+
},
|
|
95
|
+
get class() {
|
|
96
|
+
return y("logo-dark hidden mx-auto mb-8", b.classNames?.logo);
|
|
97
|
+
},
|
|
98
|
+
height: 48,
|
|
99
|
+
get src() {
|
|
100
|
+
return b.logoURL.dark;
|
|
101
|
+
},
|
|
102
|
+
width: 48
|
|
103
|
+
})]),
|
|
104
|
+
t(s, {
|
|
105
|
+
get class() {
|
|
106
|
+
return y("m-0 mb-5 font-semibold text-2xl", b.classNames?.title);
|
|
107
|
+
},
|
|
108
|
+
get children() {
|
|
109
|
+
return T().RESET_YOUR_PASSWORD;
|
|
110
|
+
}
|
|
111
|
+
}),
|
|
112
|
+
t(h, {
|
|
113
|
+
get class() {
|
|
114
|
+
return y("text-sm", b.classNames?.content);
|
|
115
|
+
},
|
|
116
|
+
get children() {
|
|
117
|
+
return E();
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
t(p, {
|
|
121
|
+
class: "my-6",
|
|
122
|
+
get children() {
|
|
123
|
+
return t(i, {
|
|
124
|
+
get class() {
|
|
125
|
+
return y("inline-block whitespace-nowrap rounded-none bg-primary px-6 py-2.5 font-medium text-primary-foreground text-sm no-underline", b.classNames?.button);
|
|
126
|
+
},
|
|
127
|
+
get href() {
|
|
128
|
+
return b.url;
|
|
129
|
+
},
|
|
130
|
+
get children() {
|
|
131
|
+
return T().RESET_PASSWORD;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
t(h, {
|
|
137
|
+
get class() {
|
|
138
|
+
return y("m-0 mb-3 text-muted-foreground text-xs", b.classNames?.description);
|
|
139
|
+
},
|
|
140
|
+
get children() {
|
|
141
|
+
return T().OR_COPY_AND_PASTE_URL;
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
t(d, {
|
|
145
|
+
get class() {
|
|
146
|
+
return y("break-all text-primary text-xs", b.classNames?.link);
|
|
147
|
+
},
|
|
148
|
+
get href() {
|
|
149
|
+
return b.url;
|
|
150
|
+
},
|
|
151
|
+
get children() {
|
|
152
|
+
return b.url;
|
|
153
|
+
}
|
|
154
|
+
}),
|
|
155
|
+
t(c, { get class() {
|
|
156
|
+
return y("my-6 w-full border border-border border-solid", b.classNames?.separator);
|
|
157
|
+
} }),
|
|
158
|
+
t(h, {
|
|
159
|
+
get class() {
|
|
160
|
+
return y("m-0 mb-3 text-muted-foreground text-xs", b.classNames?.description);
|
|
161
|
+
},
|
|
162
|
+
get children() {
|
|
163
|
+
return [T().THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", C().toString()), t(g, {
|
|
164
|
+
get when() {
|
|
165
|
+
return b.appName;
|
|
166
|
+
},
|
|
167
|
+
children: (e) => ` ${T().EMAIL_SENT_BY.replace("{appName}", e())}`
|
|
168
|
+
})];
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
t(h, {
|
|
172
|
+
get class() {
|
|
173
|
+
return y("m-0 text-muted-foreground text-xs", b.classNames?.description);
|
|
174
|
+
},
|
|
175
|
+
get children() {
|
|
176
|
+
return T().IF_YOU_DIDNT_REQUEST_PASSWORD_RESET;
|
|
177
|
+
}
|
|
178
|
+
}),
|
|
179
|
+
t(g, {
|
|
180
|
+
get when() {
|
|
181
|
+
return b.poweredBy;
|
|
182
|
+
},
|
|
183
|
+
get children() {
|
|
184
|
+
return t(h, {
|
|
185
|
+
get class() {
|
|
186
|
+
return y("m-0 mt-4 text-center text-[11px] text-muted-foreground", b.classNames?.poweredBy);
|
|
187
|
+
},
|
|
188
|
+
get children() {
|
|
189
|
+
return T().POWERED_BY_BETTER_AUTH.replace("{betterAuth}", "better-auth");
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
} })
|
|
202
|
+
];
|
|
203
|
+
} });
|
|
204
|
+
}
|
|
205
|
+
S.localization = b, S.PreviewProps = {
|
|
206
|
+
url: "https://better-auth-ui.com/auth/reset-password?token=example-token",
|
|
207
|
+
email: "m@example.com",
|
|
208
|
+
appName: "Better Auth",
|
|
209
|
+
darkMode: !0
|
|
210
|
+
};
|
|
211
|
+
//#endregion
|
|
212
|
+
export { S as default };
|
package/dist/email.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { EmailChangedEmailLocalization, EmailChangedEmailProps } from './components/auth/email/email-changed.js';
|
|
2
|
+
export { default as EmailChangedEmail } from './components/auth/email/email-changed.js';
|
|
3
|
+
export type { EmailClassNames, EmailColors } from './components/auth/email/email-styles.js';
|
|
4
|
+
export { default as EmailStyles, defaultColors } from './components/auth/email/email-styles.js';
|
|
5
|
+
export type { EmailVerificationEmailLocalization, EmailVerificationEmailProps } from './components/auth/email/email-verification.js';
|
|
6
|
+
export { default as EmailVerificationEmail } from './components/auth/email/email-verification.js';
|
|
7
|
+
export type { MagicLinkEmailLocalization, MagicLinkEmailProps } from './components/auth/email/magic-link.js';
|
|
8
|
+
export { default as MagicLinkEmail } from './components/auth/email/magic-link.js';
|
|
9
|
+
export type { DeviceInfo, NewDeviceEmailLocalization, NewDeviceEmailProps } from './components/auth/email/new-device.js';
|
|
10
|
+
export { default as NewDeviceEmail } from './components/auth/email/new-device.js';
|
|
11
|
+
export type { OrganizationInvitationEmailLocalization, OrganizationInvitationEmailProps } from './components/auth/email/organization-invitation.js';
|
|
12
|
+
export { default as OrganizationInvitationEmail } from './components/auth/email/organization-invitation.js';
|
|
13
|
+
export type { OtpEmailEmailLocalization, OtpEmailProps } from './components/auth/email/otp-email.js';
|
|
14
|
+
export { default as OtpEmail } from './components/auth/email/otp-email.js';
|
|
15
|
+
export type { PasswordChangedEmailLocalization, PasswordChangedEmailProps } from './components/auth/email/password-changed.js';
|
|
16
|
+
export { default as PasswordChangedEmail } from './components/auth/email/password-changed.js';
|
|
17
|
+
export type { ResetPasswordEmailLocalization, ResetPasswordEmailProps } from './components/auth/email/reset-password.js';
|
|
18
|
+
export { default as ResetPasswordEmail } from './components/auth/email/reset-password.js';
|
package/dist/email.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e, { defaultColors as t } from "./components/auth/email/email-styles.js";
|
|
2
|
+
import n from "./components/auth/email/email-changed.js";
|
|
3
|
+
import r from "./components/auth/email/email-verification.js";
|
|
4
|
+
import i from "./components/auth/email/magic-link.js";
|
|
5
|
+
import a from "./components/auth/email/new-device.js";
|
|
6
|
+
import o from "./components/auth/email/organization-invitation.js";
|
|
7
|
+
import s from "./components/auth/email/otp-email.js";
|
|
8
|
+
import c from "./components/auth/email/password-changed.js";
|
|
9
|
+
import l from "./components/auth/email/reset-password.js";
|
|
10
|
+
export { n as EmailChangedEmail, e as EmailStyles, r as EmailVerificationEmail, i as MagicLinkEmail, a as NewDeviceEmail, o as OrganizationInvitationEmail, s as OtpEmail, c as PasswordChangedEmail, l as ResetPasswordEmail, t as defaultColors };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseSessionOptions } from '../../queries/auth/session-query';
|
|
3
|
+
export declare function useAuthenticate<TAuthClient extends AuthClient>(authClient: TAuthClient, options?: UseSessionOptions<TAuthClient>): import('@tanstack/solid-query').CreateQueryResult<import('../..').InferData<TAuthClient["getSession"]>, import('better-auth/solid').BetterFetchError>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAuth as e } from "../../lib/auth-provider.js";
|
|
2
|
+
import { useSession as t } from "../../queries/auth/session-query.js";
|
|
3
|
+
import { createEffect as n } from "solid-js";
|
|
4
|
+
import { isServer as r } from "solid-js/web";
|
|
5
|
+
//#region src/hooks/auth/use-authenticate.ts
|
|
6
|
+
function i(i, a) {
|
|
7
|
+
let o = e(), s = t(i, a);
|
|
8
|
+
return n(() => {
|
|
9
|
+
if (s.data || s.isPending) return;
|
|
10
|
+
let e = r ? "/" : window.location.pathname + window.location.search, t = encodeURIComponent(e), n = `${o.basePaths.auth}/${o.viewPaths.auth.signIn}?redirectTo=${t}`;
|
|
11
|
+
o.navigate({
|
|
12
|
+
to: n,
|
|
13
|
+
replace: !0
|
|
14
|
+
});
|
|
15
|
+
}), s;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { i as useAuthenticate };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createMutation as e, useQueryClient as t } from "@tanstack/solid-query";
|
|
2
|
+
import { authMutationKeys as n, authQueryKeys as r } from "@better-auth-ui/core";
|
|
3
|
+
//#region src/hooks/auth/use-sign-out.ts
|
|
4
|
+
function i(i) {
|
|
5
|
+
let a = t();
|
|
6
|
+
return e(() => ({
|
|
7
|
+
mutationKey: n.signOut,
|
|
8
|
+
mutationFn: async () => {
|
|
9
|
+
await i.signOut({ fetchOptions: { throw: !0 } });
|
|
10
|
+
},
|
|
11
|
+
onSuccess: () => {
|
|
12
|
+
a.removeQueries({ queryKey: r.all });
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as useSignOut };
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseSessionOptions } from '../../queries/auth/session-query';
|
|
3
|
+
export declare function useUser<TAuthClient extends AuthClient>(authClient: TAuthClient, options?: UseSessionOptions<TAuthClient>): {
|
|
4
|
+
data: import('better-auth').StripEmptyObjects<{
|
|
5
|
+
id: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
updatedAt: Date;
|
|
8
|
+
email: string;
|
|
9
|
+
emailVerified: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
image?: string | null | undefined;
|
|
12
|
+
}> | undefined;
|
|
13
|
+
error: import('better-auth/solid').BetterFetchError;
|
|
14
|
+
isError: true;
|
|
15
|
+
isPending: false;
|
|
16
|
+
isLoading: false;
|
|
17
|
+
isLoadingError: false;
|
|
18
|
+
isRefetchError: true;
|
|
19
|
+
isSuccess: false;
|
|
20
|
+
isPlaceholderData: false;
|
|
21
|
+
status: "error";
|
|
22
|
+
dataUpdatedAt: number;
|
|
23
|
+
errorUpdatedAt: number;
|
|
24
|
+
failureCount: number;
|
|
25
|
+
failureReason: import('better-auth/solid').BetterFetchError | null;
|
|
26
|
+
errorUpdateCount: number;
|
|
27
|
+
isFetched: boolean;
|
|
28
|
+
isFetchedAfterMount: boolean;
|
|
29
|
+
isFetching: boolean;
|
|
30
|
+
isInitialLoading: boolean;
|
|
31
|
+
isPaused: boolean;
|
|
32
|
+
isRefetching: boolean;
|
|
33
|
+
isStale: boolean;
|
|
34
|
+
isEnabled: boolean;
|
|
35
|
+
refetch: (options?: import('@tanstack/solid-query').RefetchOptions) => Promise<import('@tanstack/solid-query').QueryObserverResult<import('../..').InferData<TAuthClient["getSession"]>, import('better-auth/solid').BetterFetchError>>;
|
|
36
|
+
fetchStatus: import('@tanstack/solid-query').FetchStatus;
|
|
37
|
+
promise: Promise<import('../..').InferData<TAuthClient["getSession"]>>;
|
|
38
|
+
} | {
|
|
39
|
+
data: import('better-auth').StripEmptyObjects<{
|
|
40
|
+
id: string;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
updatedAt: Date;
|
|
43
|
+
email: string;
|
|
44
|
+
emailVerified: boolean;
|
|
45
|
+
name: string;
|
|
46
|
+
image?: string | null | undefined;
|
|
47
|
+
}> | undefined;
|
|
48
|
+
error: null;
|
|
49
|
+
isError: false;
|
|
50
|
+
isPending: false;
|
|
51
|
+
isLoading: false;
|
|
52
|
+
isLoadingError: false;
|
|
53
|
+
isRefetchError: false;
|
|
54
|
+
isSuccess: true;
|
|
55
|
+
isPlaceholderData: false;
|
|
56
|
+
status: "success";
|
|
57
|
+
dataUpdatedAt: number;
|
|
58
|
+
errorUpdatedAt: number;
|
|
59
|
+
failureCount: number;
|
|
60
|
+
failureReason: import('better-auth/solid').BetterFetchError | null;
|
|
61
|
+
errorUpdateCount: number;
|
|
62
|
+
isFetched: boolean;
|
|
63
|
+
isFetchedAfterMount: boolean;
|
|
64
|
+
isFetching: boolean;
|
|
65
|
+
isInitialLoading: boolean;
|
|
66
|
+
isPaused: boolean;
|
|
67
|
+
isRefetching: boolean;
|
|
68
|
+
isStale: boolean;
|
|
69
|
+
isEnabled: boolean;
|
|
70
|
+
refetch: (options?: import('@tanstack/solid-query').RefetchOptions) => Promise<import('@tanstack/solid-query').QueryObserverResult<import('../..').InferData<TAuthClient["getSession"]>, import('better-auth/solid').BetterFetchError>>;
|
|
71
|
+
fetchStatus: import('@tanstack/solid-query').FetchStatus;
|
|
72
|
+
promise: Promise<import('../..').InferData<TAuthClient["getSession"]>>;
|
|
73
|
+
} | {
|
|
74
|
+
data: import('better-auth').StripEmptyObjects<{
|
|
75
|
+
id: string;
|
|
76
|
+
createdAt: Date;
|
|
77
|
+
updatedAt: Date;
|
|
78
|
+
email: string;
|
|
79
|
+
emailVerified: boolean;
|
|
80
|
+
name: string;
|
|
81
|
+
image?: string | null | undefined;
|
|
82
|
+
}> | undefined;
|
|
83
|
+
error: import('better-auth/solid').BetterFetchError;
|
|
84
|
+
isError: true;
|
|
85
|
+
isPending: false;
|
|
86
|
+
isLoading: false;
|
|
87
|
+
isLoadingError: true;
|
|
88
|
+
isRefetchError: false;
|
|
89
|
+
isSuccess: false;
|
|
90
|
+
isPlaceholderData: false;
|
|
91
|
+
status: "error";
|
|
92
|
+
dataUpdatedAt: number;
|
|
93
|
+
errorUpdatedAt: number;
|
|
94
|
+
failureCount: number;
|
|
95
|
+
failureReason: import('better-auth/solid').BetterFetchError | null;
|
|
96
|
+
errorUpdateCount: number;
|
|
97
|
+
isFetched: boolean;
|
|
98
|
+
isFetchedAfterMount: boolean;
|
|
99
|
+
isFetching: boolean;
|
|
100
|
+
isInitialLoading: boolean;
|
|
101
|
+
isPaused: boolean;
|
|
102
|
+
isRefetching: boolean;
|
|
103
|
+
isStale: boolean;
|
|
104
|
+
isEnabled: boolean;
|
|
105
|
+
refetch: (options?: import('@tanstack/solid-query').RefetchOptions) => Promise<import('@tanstack/solid-query').QueryObserverResult<import('../..').InferData<TAuthClient["getSession"]>, import('better-auth/solid').BetterFetchError>>;
|
|
106
|
+
fetchStatus: import('@tanstack/solid-query').FetchStatus;
|
|
107
|
+
promise: Promise<import('../..').InferData<TAuthClient["getSession"]>>;
|
|
108
|
+
} | {
|
|
109
|
+
data: import('better-auth').StripEmptyObjects<{
|
|
110
|
+
id: string;
|
|
111
|
+
createdAt: Date;
|
|
112
|
+
updatedAt: Date;
|
|
113
|
+
email: string;
|
|
114
|
+
emailVerified: boolean;
|
|
115
|
+
name: string;
|
|
116
|
+
image?: string | null | undefined;
|
|
117
|
+
}> | undefined;
|
|
118
|
+
error: null;
|
|
119
|
+
isError: false;
|
|
120
|
+
isPending: true;
|
|
121
|
+
isLoading: true;
|
|
122
|
+
isLoadingError: false;
|
|
123
|
+
isRefetchError: false;
|
|
124
|
+
isSuccess: false;
|
|
125
|
+
isPlaceholderData: false;
|
|
126
|
+
status: "pending";
|
|
127
|
+
dataUpdatedAt: number;
|
|
128
|
+
errorUpdatedAt: number;
|
|
129
|
+
failureCount: number;
|
|
130
|
+
failureReason: import('better-auth/solid').BetterFetchError | null;
|
|
131
|
+
errorUpdateCount: number;
|
|
132
|
+
isFetched: boolean;
|
|
133
|
+
isFetchedAfterMount: boolean;
|
|
134
|
+
isFetching: boolean;
|
|
135
|
+
isInitialLoading: boolean;
|
|
136
|
+
isPaused: boolean;
|
|
137
|
+
isRefetching: boolean;
|
|
138
|
+
isStale: boolean;
|
|
139
|
+
isEnabled: boolean;
|
|
140
|
+
refetch: (options?: import('@tanstack/solid-query').RefetchOptions) => Promise<import('@tanstack/solid-query').QueryObserverResult<import('../..').InferData<TAuthClient["getSession"]>, import('better-auth/solid').BetterFetchError>>;
|
|
141
|
+
fetchStatus: import('@tanstack/solid-query').FetchStatus;
|
|
142
|
+
promise: Promise<import('../..').InferData<TAuthClient["getSession"]>>;
|
|
143
|
+
} | {
|
|
144
|
+
data: import('better-auth').StripEmptyObjects<{
|
|
145
|
+
id: string;
|
|
146
|
+
createdAt: Date;
|
|
147
|
+
updatedAt: Date;
|
|
148
|
+
email: string;
|
|
149
|
+
emailVerified: boolean;
|
|
150
|
+
name: string;
|
|
151
|
+
image?: string | null | undefined;
|
|
152
|
+
}> | undefined;
|
|
153
|
+
error: null;
|
|
154
|
+
isError: false;
|
|
155
|
+
isPending: true;
|
|
156
|
+
isLoadingError: false;
|
|
157
|
+
isRefetchError: false;
|
|
158
|
+
isSuccess: false;
|
|
159
|
+
isPlaceholderData: false;
|
|
160
|
+
status: "pending";
|
|
161
|
+
dataUpdatedAt: number;
|
|
162
|
+
errorUpdatedAt: number;
|
|
163
|
+
failureCount: number;
|
|
164
|
+
failureReason: import('better-auth/solid').BetterFetchError | null;
|
|
165
|
+
errorUpdateCount: number;
|
|
166
|
+
isFetched: boolean;
|
|
167
|
+
isFetchedAfterMount: boolean;
|
|
168
|
+
isFetching: boolean;
|
|
169
|
+
isLoading: boolean;
|
|
170
|
+
isInitialLoading: boolean;
|
|
171
|
+
isPaused: boolean;
|
|
172
|
+
isRefetching: boolean;
|
|
173
|
+
isStale: boolean;
|
|
174
|
+
isEnabled: boolean;
|
|
175
|
+
refetch: (options?: import('@tanstack/solid-query').RefetchOptions) => Promise<import('@tanstack/solid-query').QueryObserverResult<import('../..').InferData<TAuthClient["getSession"]>, import('better-auth/solid').BetterFetchError>>;
|
|
176
|
+
fetchStatus: import('@tanstack/solid-query').FetchStatus;
|
|
177
|
+
promise: Promise<import('../..').InferData<TAuthClient["getSession"]>>;
|
|
178
|
+
} | {
|
|
179
|
+
data: import('better-auth').StripEmptyObjects<{
|
|
180
|
+
id: string;
|
|
181
|
+
createdAt: Date;
|
|
182
|
+
updatedAt: Date;
|
|
183
|
+
email: string;
|
|
184
|
+
emailVerified: boolean;
|
|
185
|
+
name: string;
|
|
186
|
+
image?: string | null | undefined;
|
|
187
|
+
}> | undefined;
|
|
188
|
+
isError: false;
|
|
189
|
+
error: null;
|
|
190
|
+
isPending: false;
|
|
191
|
+
isLoading: false;
|
|
192
|
+
isLoadingError: false;
|
|
193
|
+
isRefetchError: false;
|
|
194
|
+
isSuccess: true;
|
|
195
|
+
isPlaceholderData: true;
|
|
196
|
+
status: "success";
|
|
197
|
+
dataUpdatedAt: number;
|
|
198
|
+
errorUpdatedAt: number;
|
|
199
|
+
failureCount: number;
|
|
200
|
+
failureReason: import('better-auth/solid').BetterFetchError | null;
|
|
201
|
+
errorUpdateCount: number;
|
|
202
|
+
isFetched: boolean;
|
|
203
|
+
isFetchedAfterMount: boolean;
|
|
204
|
+
isFetching: boolean;
|
|
205
|
+
isInitialLoading: boolean;
|
|
206
|
+
isPaused: boolean;
|
|
207
|
+
isRefetching: boolean;
|
|
208
|
+
isStale: boolean;
|
|
209
|
+
isEnabled: boolean;
|
|
210
|
+
refetch: (options?: import('@tanstack/solid-query').RefetchOptions) => Promise<import('@tanstack/solid-query').QueryObserverResult<import('../..').InferData<TAuthClient["getSession"]>, import('better-auth/solid').BetterFetchError>>;
|
|
211
|
+
fetchStatus: import('@tanstack/solid-query').FetchStatus;
|
|
212
|
+
promise: Promise<import('../..').InferData<TAuthClient["getSession"]>>;
|
|
213
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useSession as e } from "../../queries/auth/session-query.js";
|
|
2
|
+
//#region src/hooks/auth/use-user.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let r = e(t, n);
|
|
5
|
+
return {
|
|
6
|
+
...r,
|
|
7
|
+
get data() {
|
|
8
|
+
return r.data?.user;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as useUser };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateMutationOptions, MutationKey } from '@tanstack/solid-query';
|
|
2
|
+
import { BetterFetchError } from 'better-auth/client';
|
|
3
|
+
import { AuthMutationFn, AuthMutationFnData, AuthMutationFnVariables } from '../mutations/auth-mutation-options';
|
|
4
|
+
type UseAuthMutationOptions<TFn extends AuthMutationFn> = Omit<CreateMutationOptions<AuthMutationFnData<TFn>, BetterFetchError, AuthMutationFnVariables<TFn>>, "mutationKey" | "mutationFn">;
|
|
5
|
+
export declare function useAuthMutation<TFn extends AuthMutationFn, const TMutationKey extends MutationKey>(authFn: TFn, mutationKey: TMutationKey, options?: UseAuthMutationOptions<TFn>): import('@tanstack/solid-query').CreateMutationResult<unknown, Error, void, unknown>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { authMutationOptions as e } from "../mutations/auth-mutation-options.js";
|
|
2
|
+
import { createMutation as t } from "@tanstack/solid-query";
|
|
3
|
+
//#region src/hooks/use-auth-mutation.ts
|
|
4
|
+
function n(n, r, i) {
|
|
5
|
+
return t(() => ({
|
|
6
|
+
...e(n, r),
|
|
7
|
+
...i
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as useAuthMutation };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { QueryKey } from '@tanstack/solid-query';
|
|
2
|
+
import { AuthQueryFn, AuthQueryOptions } from '../queries/auth-query-options';
|
|
3
|
+
type UseAuthQueryOptions<TFn extends AuthQueryFn, TPrefix extends QueryKey> = Omit<AuthQueryOptions<TFn, TPrefix>, "queryKey" | "queryFn"> & Pick<NonNullable<Parameters<TFn>[0]>, "query" | "fetchOptions">;
|
|
4
|
+
export declare function useAuthQuery<TFn extends AuthQueryFn, const TQueryKey extends QueryKey>(authFn: TFn, queryKey: TQueryKey, options?: UseAuthQueryOptions<TFn, TQueryKey>): import('@tanstack/solid-query').CreateQueryResult<unknown, Error>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { authQueryOptions as e } from "../queries/auth-query-options.js";
|
|
2
|
+
import { createQuery as t } from "@tanstack/solid-query";
|
|
3
|
+
//#region src/hooks/use-auth-query.ts
|
|
4
|
+
function n(n, r, i) {
|
|
5
|
+
return t(() => {
|
|
6
|
+
let { query: t, fetchOptions: a, ...o } = i ?? {};
|
|
7
|
+
return {
|
|
8
|
+
...e(n, r, {
|
|
9
|
+
query: t,
|
|
10
|
+
fetchOptions: a
|
|
11
|
+
}),
|
|
12
|
+
...o
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as useAuthQuery };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export { createAuthClient } from 'better-auth/solid';
|
|
2
|
+
export * from './hooks/auth/use-authenticate';
|
|
3
|
+
export * from './hooks/auth/use-sign-out';
|
|
4
|
+
export * from './hooks/auth/use-user';
|
|
5
|
+
export * from './hooks/use-auth-mutation';
|
|
6
|
+
export * from './hooks/use-auth-query';
|
|
7
|
+
export type * from './lib/auth-client';
|
|
8
|
+
export * from './lib/auth-config';
|
|
9
|
+
export * from './lib/auth-provider';
|
|
10
|
+
export * from './lib/auth-utils';
|
|
11
|
+
export * from './lib/fetch-options-provider';
|
|
12
|
+
export * from './lib/mutation-invalidator';
|
|
13
|
+
export * from './lib/provider-icons';
|
|
14
|
+
export * from './mutations/api-key/create-api-key-mutation';
|
|
15
|
+
export * from './mutations/api-key/delete-api-key-mutation';
|
|
16
|
+
export * from './mutations/auth/request-password-reset-mutation';
|
|
17
|
+
export * from './mutations/auth/reset-password-mutation';
|
|
18
|
+
export * from './mutations/auth/send-verification-email-mutation';
|
|
19
|
+
export * from './mutations/auth/sign-in-email-mutation';
|
|
20
|
+
export * from './mutations/auth/sign-in-social-mutation';
|
|
21
|
+
export * from './mutations/auth/sign-out-mutation';
|
|
22
|
+
export * from './mutations/auth/sign-up-email-mutation';
|
|
23
|
+
export * from './mutations/auth-mutation-options';
|
|
24
|
+
export * from './mutations/magic-link/sign-in-magic-link-mutation';
|
|
25
|
+
export * from './mutations/multi-session/revoke-multi-session-mutation';
|
|
26
|
+
export * from './mutations/multi-session/set-active-session-mutation';
|
|
27
|
+
export * from './mutations/organization';
|
|
28
|
+
export * from './mutations/passkey/add-passkey-mutation';
|
|
29
|
+
export * from './mutations/passkey/delete-passkey-mutation';
|
|
30
|
+
export * from './mutations/passkey/sign-in-passkey-mutation';
|
|
31
|
+
export * from './mutations/settings/change-email-mutation';
|
|
32
|
+
export * from './mutations/settings/change-password-mutation';
|
|
33
|
+
export * from './mutations/settings/delete-user-mutation';
|
|
34
|
+
export * from './mutations/settings/link-social-mutation';
|
|
35
|
+
export * from './mutations/settings/revoke-session-mutation';
|
|
36
|
+
export * from './mutations/settings/unlink-account-mutation';
|
|
37
|
+
export * from './mutations/settings/update-user-mutation';
|
|
38
|
+
export * from './mutations/username/is-username-available-mutation';
|
|
39
|
+
export * from './mutations/username/sign-in-username-mutation';
|
|
40
|
+
export * from './queries/api-key/list-api-keys-query';
|
|
41
|
+
export * from './queries/auth/session-query';
|
|
42
|
+
export * from './queries/auth-query-options';
|
|
43
|
+
export * from './queries/multi-session/list-device-sessions-query';
|
|
44
|
+
export * from './queries/organization';
|
|
45
|
+
export * from './queries/passkey/list-passkeys-query';
|
|
46
|
+
export * from './queries/settings/account-info-query';
|
|
47
|
+
export * from './queries/settings/list-accounts-query';
|
|
48
|
+
export * from './queries/settings/list-sessions-query';
|