@better-auth-ui/react 1.6.3 → 1.6.4
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/auth-provider.d.ts +23 -8
- package/dist/components/auth/auth-provider.js +32 -17
- package/dist/components/{email → auth/email}/email-changed.js +2 -2
- package/dist/components/{email → auth/email}/email-localization.js +1 -1
- package/dist/components/{email → auth/email}/email-styles.js +1 -1
- package/dist/components/{email → auth/email}/email-verification.js +2 -2
- package/dist/components/{email → auth/email}/magic-link.js +2 -2
- package/dist/components/{email → auth/email}/new-device.js +2 -2
- package/dist/components/{email → auth/email}/otp-email.js +2 -2
- package/dist/components/{email → auth/email}/password-changed.js +2 -2
- package/dist/components/{email → auth/email}/reset-password.js +2 -2
- package/dist/email.d.ts +1 -0
- package/dist/email.js +11 -0
- package/dist/hooks/auth/use-authenticate.d.ts +5 -28
- package/dist/hooks/auth/use-authenticate.js +12 -12
- package/dist/hooks/auth/use-user.d.ts +19 -314
- package/dist/hooks/auth/use-user.js +5 -5
- package/dist/hooks/use-auth-mutation.d.ts +12 -7
- package/dist/hooks/use-auth-plugin.d.ts +31 -0
- package/dist/hooks/use-auth-plugin.js +10 -0
- package/dist/hooks/use-auth-query.d.ts +3 -3
- package/dist/index.d.ts +33 -32
- package/dist/index.js +74 -83
- package/dist/lib/auth-client.d.ts +23 -3687
- package/dist/lib/auth-plugin.d.ts +59 -0
- package/dist/lib/auth-server.d.ts +16 -0
- package/dist/mutations/auth/request-password-reset-mutation.d.ts +26 -0
- package/dist/mutations/auth/request-password-reset-mutation.js +24 -0
- package/dist/mutations/auth/reset-password-mutation.d.ts +25 -0
- package/dist/mutations/auth/reset-password-mutation.js +24 -0
- package/dist/mutations/auth/send-verification-email-mutation.d.ts +24 -0
- package/dist/mutations/auth/send-verification-email-mutation.js +24 -0
- package/dist/mutations/auth/sign-in-email-mutation.d.ts +71 -0
- package/dist/mutations/auth/sign-in-email-mutation.js +29 -0
- package/dist/mutations/auth/sign-in-social-mutation.d.ts +77 -0
- package/dist/mutations/auth/sign-in-social-mutation.js +24 -0
- package/dist/mutations/auth/sign-out-mutation.d.ts +25 -0
- package/dist/mutations/auth/sign-out-mutation.js +28 -0
- package/dist/mutations/auth/sign-up-email-mutation.d.ts +105 -0
- package/dist/mutations/auth/sign-up-email-mutation.js +29 -0
- package/dist/mutations/auth-mutation-options.d.ts +37 -20
- package/dist/mutations/auth-mutation-options.js +2 -2
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +24 -0
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +24 -0
- package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +25 -0
- package/dist/mutations/multi-session/revoke-multi-session-mutation.js +29 -0
- package/dist/mutations/multi-session/set-active-session-mutation.d.ts +62 -0
- package/dist/mutations/multi-session/set-active-session-mutation.js +31 -0
- package/dist/mutations/passkey/add-passkey-mutation.d.ts +71 -0
- package/dist/mutations/passkey/add-passkey-mutation.js +29 -0
- package/dist/mutations/passkey/delete-passkey-mutation.d.ts +25 -0
- package/dist/mutations/passkey/delete-passkey-mutation.js +29 -0
- package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +105 -0
- package/dist/mutations/passkey/sign-in-passkey-mutation.js +29 -0
- package/dist/mutations/settings/change-email-mutation.d.ts +25 -0
- package/dist/mutations/settings/change-email-mutation.js +29 -0
- package/dist/mutations/settings/change-password-mutation.d.ts +78 -0
- package/dist/mutations/settings/change-password-mutation.js +24 -0
- package/dist/mutations/settings/delete-user-mutation.d.ts +26 -0
- package/dist/mutations/settings/delete-user-mutation.js +24 -0
- package/dist/mutations/settings/link-social-mutation.d.ts +26 -0
- package/dist/mutations/settings/link-social-mutation.js +24 -0
- package/dist/mutations/settings/revoke-session-mutation.d.ts +25 -0
- package/dist/mutations/settings/revoke-session-mutation.js +29 -0
- package/dist/mutations/settings/unlink-account-mutation.d.ts +25 -0
- package/dist/mutations/settings/unlink-account-mutation.js +29 -0
- package/dist/mutations/settings/update-user-mutation.d.ts +25 -0
- package/dist/mutations/settings/update-user-mutation.js +35 -0
- package/dist/mutations/username/is-username-available-mutation.d.ts +27 -0
- package/dist/mutations/username/is-username-available-mutation.js +24 -0
- package/dist/mutations/username/sign-in-username-mutation.d.ts +75 -0
- package/dist/mutations/username/sign-in-username-mutation.js +29 -0
- package/dist/queries/auth/session-query.d.ts +71 -0
- package/dist/queries/auth/session-query.js +30 -0
- package/dist/queries/auth-query-options.d.ts +26 -15
- package/dist/queries/multi-session/list-device-sessions-query.d.ts +76 -0
- package/dist/queries/multi-session/list-device-sessions-query.js +31 -0
- package/dist/queries/passkey/list-passkeys-query.d.ts +74 -0
- package/dist/queries/passkey/list-passkeys-query.js +31 -0
- package/dist/queries/settings/account-info-query.d.ts +85 -0
- package/dist/queries/settings/account-info-query.js +31 -0
- package/dist/queries/settings/list-accounts-query.d.ts +76 -0
- package/dist/queries/settings/list-accounts-query.js +31 -0
- package/dist/queries/settings/list-sessions-query.d.ts +74 -0
- package/dist/queries/settings/list-sessions-query.js +31 -0
- package/dist/server/queries/auth/session-query.d.ts +57 -0
- package/dist/server/queries/auth/session-query.js +13 -0
- package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +60 -0
- package/dist/server/queries/multi-session/list-device-sessions-query.js +12 -0
- package/dist/server/queries/passkey/list-passkeys-query.d.ts +60 -0
- package/dist/server/queries/passkey/list-passkeys-query.js +12 -0
- package/dist/server/queries/settings/account-info-query.d.ts +68 -0
- package/dist/server/queries/settings/account-info-query.js +12 -0
- package/dist/server/queries/settings/list-accounts-query.d.ts +60 -0
- package/dist/server/queries/settings/list-accounts-query.js +12 -0
- package/dist/server/queries/settings/list-sessions-query.d.ts +60 -0
- package/dist/server/queries/settings/list-sessions-query.js +12 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +7 -0
- package/package.json +24 -22
- package/src/components/auth/auth-provider.tsx +87 -24
- package/src/components/{email → auth/email}/email-changed.tsx +1 -1
- package/src/components/{email → auth/email}/email-verification.tsx +1 -1
- package/src/components/{email → auth/email}/magic-link.tsx +1 -1
- package/src/components/{email → auth/email}/new-device.tsx +1 -1
- package/src/components/{email → auth/email}/otp-email.tsx +1 -1
- package/src/components/{email → auth/email}/password-changed.tsx +1 -1
- package/src/components/{email → auth/email}/reset-password.tsx +1 -1
- package/src/email.ts +1 -0
- package/src/hooks/auth/use-authenticate.ts +12 -6
- package/src/hooks/auth/use-user.ts +14 -9
- package/src/hooks/use-auth-mutation.ts +30 -12
- package/src/hooks/use-auth-plugin.ts +50 -0
- package/src/hooks/use-auth-query.ts +11 -7
- package/src/index.ts +33 -32
- package/src/lib/auth-client.ts +33 -31
- package/src/lib/auth-plugin.ts +75 -0
- package/src/lib/auth-server.ts +30 -0
- package/src/mutations/auth/request-password-reset-mutation.ts +58 -0
- package/src/mutations/auth/reset-password-mutation.ts +60 -0
- package/src/mutations/auth/send-verification-email-mutation.ts +58 -0
- package/src/mutations/auth/sign-in-email-mutation.ts +78 -0
- package/src/mutations/auth/sign-in-social-mutation.ts +64 -0
- package/src/mutations/auth/sign-out-mutation.ts +71 -0
- package/src/mutations/auth/sign-up-email-mutation.ts +74 -0
- package/src/mutations/auth-mutation-options.ts +83 -38
- package/src/mutations/magic-link/sign-in-magic-link-mutation.ts +59 -0
- package/src/mutations/multi-session/revoke-multi-session-mutation.ts +70 -0
- package/src/mutations/multi-session/set-active-session-mutation.ts +98 -0
- package/src/mutations/passkey/add-passkey-mutation.ts +66 -0
- package/src/mutations/passkey/delete-passkey-mutation.ts +66 -0
- package/src/mutations/passkey/sign-in-passkey-mutation.ts +74 -0
- package/src/mutations/settings/change-email-mutation.ts +67 -0
- package/src/mutations/settings/change-password-mutation.ts +59 -0
- package/src/mutations/settings/delete-user-mutation.ts +59 -0
- package/src/mutations/settings/link-social-mutation.ts +59 -0
- package/src/mutations/settings/revoke-session-mutation.ts +69 -0
- package/src/mutations/settings/unlink-account-mutation.ts +67 -0
- package/src/mutations/settings/update-user-mutation.ts +82 -0
- package/src/mutations/username/is-username-available-mutation.ts +62 -0
- package/src/mutations/username/sign-in-username-mutation.ts +74 -0
- package/src/queries/auth/session-query.ts +135 -0
- package/src/queries/auth-query-options.ts +61 -12
- package/src/queries/multi-session/list-device-sessions-query.ts +177 -0
- package/src/queries/passkey/list-passkeys-query.ts +154 -0
- package/src/queries/settings/account-info-query.ts +158 -0
- package/src/queries/settings/list-accounts-query.ts +156 -0
- package/src/queries/settings/list-sessions-query.ts +154 -0
- package/src/server/queries/auth/session-query.ts +94 -0
- package/src/server/queries/multi-session/list-device-sessions-query.ts +102 -0
- package/src/server/queries/passkey/list-passkeys-query.ts +100 -0
- package/src/server/queries/settings/account-info-query.ts +101 -0
- package/src/server/queries/settings/list-accounts-query.ts +101 -0
- package/src/server/queries/settings/list-sessions-query.ts +101 -0
- package/src/server.ts +7 -0
- package/dist/core.d.ts +0 -1
- package/dist/core.js +0 -1
- package/dist/hooks/auth/use-is-username-available.d.ts +0 -20
- package/dist/hooks/auth/use-is-username-available.js +0 -13
- package/dist/hooks/auth/use-request-password-reset.d.ts +0 -21
- package/dist/hooks/auth/use-request-password-reset.js +0 -13
- package/dist/hooks/auth/use-reset-password.d.ts +0 -23
- package/dist/hooks/auth/use-reset-password.js +0 -13
- package/dist/hooks/auth/use-send-verification-email.d.ts +0 -19
- package/dist/hooks/auth/use-send-verification-email.js +0 -13
- package/dist/hooks/auth/use-session.d.ts +0 -35
- package/dist/hooks/auth/use-session.js +0 -16
- package/dist/hooks/auth/use-sign-in-email.d.ts +0 -26
- package/dist/hooks/auth/use-sign-in-email.js +0 -17
- package/dist/hooks/auth/use-sign-in-magic-link.d.ts +0 -27
- package/dist/hooks/auth/use-sign-in-magic-link.js +0 -13
- package/dist/hooks/auth/use-sign-in-passkey.d.ts +0 -21
- package/dist/hooks/auth/use-sign-in-passkey.js +0 -17
- package/dist/hooks/auth/use-sign-in-social.d.ts +0 -63
- package/dist/hooks/auth/use-sign-in-social.js +0 -13
- package/dist/hooks/auth/use-sign-in-username.d.ts +0 -25
- package/dist/hooks/auth/use-sign-in-username.js +0 -17
- package/dist/hooks/auth/use-sign-out.d.ts +0 -18
- package/dist/hooks/auth/use-sign-out.js +0 -16
- package/dist/hooks/auth/use-sign-up-email.d.ts +0 -1186
- package/dist/hooks/auth/use-sign-up-email.js +0 -17
- package/dist/hooks/settings/use-account-info.d.ts +0 -17
- package/dist/hooks/settings/use-account-info.js +0 -18
- package/dist/hooks/settings/use-add-passkey.d.ts +0 -21
- package/dist/hooks/settings/use-add-passkey.js +0 -17
- package/dist/hooks/settings/use-change-email.d.ts +0 -21
- package/dist/hooks/settings/use-change-email.js +0 -17
- package/dist/hooks/settings/use-change-password.d.ts +0 -21
- package/dist/hooks/settings/use-change-password.js +0 -13
- package/dist/hooks/settings/use-delete-passkey.d.ts +0 -19
- package/dist/hooks/settings/use-delete-passkey.js +0 -17
- package/dist/hooks/settings/use-delete-user.d.ts +0 -24
- package/dist/hooks/settings/use-delete-user.js +0 -13
- package/dist/hooks/settings/use-link-social.d.ts +0 -43
- package/dist/hooks/settings/use-link-social.js +0 -13
- package/dist/hooks/settings/use-list-accounts.d.ts +0 -22
- package/dist/hooks/settings/use-list-accounts.js +0 -15
- package/dist/hooks/settings/use-list-device-sessions.d.ts +0 -34
- package/dist/hooks/settings/use-list-device-sessions.js +0 -15
- package/dist/hooks/settings/use-list-sessions.d.ts +0 -23
- package/dist/hooks/settings/use-list-sessions.js +0 -15
- package/dist/hooks/settings/use-list-user-passkeys.d.ts +0 -14
- package/dist/hooks/settings/use-list-user-passkeys.js +0 -15
- package/dist/hooks/settings/use-revoke-multi-session.d.ts +0 -19
- package/dist/hooks/settings/use-revoke-multi-session.js +0 -17
- package/dist/hooks/settings/use-revoke-session.d.ts +0 -19
- package/dist/hooks/settings/use-revoke-session.js +0 -17
- package/dist/hooks/settings/use-set-active-session.d.ts +0 -20
- package/dist/hooks/settings/use-set-active-session.js +0 -20
- package/dist/hooks/settings/use-unlink-account.d.ts +0 -21
- package/dist/hooks/settings/use-unlink-account.js +0 -17
- package/dist/hooks/settings/use-update-user.d.ts +0 -1185
- package/dist/hooks/settings/use-update-user.js +0 -24
- package/dist/lib/auth-client.js +0 -11
- package/dist/lib/auth-config.d.ts +0 -43
- package/dist/lib/auth-context.d.ts +0 -2
- package/dist/lib/auth-context.js +0 -6
- package/dist/mutations/auth/is-username-available-options.d.ts +0 -19
- package/dist/mutations/auth/is-username-available-options.js +0 -7
- package/dist/mutations/auth/request-password-reset-options.d.ts +0 -15
- package/dist/mutations/auth/request-password-reset-options.js +0 -7
- package/dist/mutations/auth/reset-password-options.d.ts +0 -17
- package/dist/mutations/auth/reset-password-options.js +0 -7
- package/dist/mutations/auth/send-verification-email-options.d.ts +0 -15
- package/dist/mutations/auth/send-verification-email-options.js +0 -7
- package/dist/mutations/auth/sign-in-email-options.d.ts +0 -23
- package/dist/mutations/auth/sign-in-email-options.js +0 -11
- package/dist/mutations/auth/sign-in-magic-link-options.d.ts +0 -23
- package/dist/mutations/auth/sign-in-magic-link-options.js +0 -11
- package/dist/mutations/auth/sign-in-passkey-options.d.ts +0 -15
- package/dist/mutations/auth/sign-in-passkey-options.js +0 -11
- package/dist/mutations/auth/sign-in-social-options.d.ts +0 -61
- package/dist/mutations/auth/sign-in-social-options.js +0 -11
- package/dist/mutations/auth/sign-in-username-options.d.ts +0 -19
- package/dist/mutations/auth/sign-in-username-options.js +0 -11
- package/dist/mutations/auth/sign-out-options.d.ts +0 -12
- package/dist/mutations/auth/sign-out-options.js +0 -7
- package/dist/mutations/auth/sign-up-email-options.d.ts +0 -1180
- package/dist/mutations/auth/sign-up-email-options.js +0 -11
- package/dist/mutations/settings/add-passkey-options.d.ts +0 -15
- package/dist/mutations/settings/add-passkey-options.js +0 -11
- package/dist/mutations/settings/change-email-options.d.ts +0 -15
- package/dist/mutations/settings/change-email-options.js +0 -7
- package/dist/mutations/settings/change-password-options.d.ts +0 -17
- package/dist/mutations/settings/change-password-options.js +0 -7
- package/dist/mutations/settings/delete-passkey-options.d.ts +0 -13
- package/dist/mutations/settings/delete-passkey-options.js +0 -11
- package/dist/mutations/settings/delete-user-options.d.ts +0 -20
- package/dist/mutations/settings/delete-user-options.js +0 -7
- package/dist/mutations/settings/link-social-options.d.ts +0 -39
- package/dist/mutations/settings/link-social-options.js +0 -7
- package/dist/mutations/settings/revoke-multi-session-options.d.ts +0 -13
- package/dist/mutations/settings/revoke-multi-session-options.js +0 -11
- package/dist/mutations/settings/revoke-session-options.d.ts +0 -13
- package/dist/mutations/settings/revoke-session-options.js +0 -7
- package/dist/mutations/settings/set-active-session-options.d.ts +0 -13
- package/dist/mutations/settings/set-active-session-options.js +0 -11
- package/dist/mutations/settings/unlink-account-options.d.ts +0 -15
- package/dist/mutations/settings/unlink-account-options.js +0 -7
- package/dist/mutations/settings/update-user-options.d.ts +0 -1182
- package/dist/mutations/settings/update-user-options.js +0 -7
- package/dist/queries/auth/session-options.d.ts +0 -110
- package/dist/queries/auth/session-options.js +0 -7
- package/dist/queries/settings/account-info-options.d.ts +0 -32
- package/dist/queries/settings/account-info-options.js +0 -12
- package/dist/queries/settings/list-accounts-options.d.ts +0 -53
- package/dist/queries/settings/list-accounts-options.js +0 -12
- package/dist/queries/settings/list-device-sessions-options.d.ts +0 -99
- package/dist/queries/settings/list-device-sessions-options.js +0 -12
- package/dist/queries/settings/list-sessions-options.d.ts +0 -54
- package/dist/queries/settings/list-sessions-options.js +0 -12
- package/dist/queries/settings/list-user-passkeys-options.d.ts +0 -18
- package/dist/queries/settings/list-user-passkeys-options.js +0 -12
- package/src/core.ts +0 -1
- package/src/hooks/auth/use-is-username-available.ts +0 -31
- package/src/hooks/auth/use-request-password-reset.ts +0 -33
- package/src/hooks/auth/use-reset-password.ts +0 -31
- package/src/hooks/auth/use-send-verification-email.ts +0 -31
- package/src/hooks/auth/use-session.ts +0 -31
- package/src/hooks/auth/use-sign-in-email.ts +0 -41
- package/src/hooks/auth/use-sign-in-magic-link.ts +0 -29
- package/src/hooks/auth/use-sign-in-passkey.ts +0 -40
- package/src/hooks/auth/use-sign-in-social.ts +0 -31
- package/src/hooks/auth/use-sign-in-username.ts +0 -40
- package/src/hooks/auth/use-sign-out.ts +0 -34
- package/src/hooks/auth/use-sign-up-email.ts +0 -40
- package/src/hooks/settings/use-account-info.ts +0 -40
- package/src/hooks/settings/use-add-passkey.ts +0 -37
- package/src/hooks/settings/use-change-email.ts +0 -37
- package/src/hooks/settings/use-change-password.ts +0 -29
- package/src/hooks/settings/use-delete-passkey.ts +0 -37
- package/src/hooks/settings/use-delete-user.ts +0 -29
- package/src/hooks/settings/use-link-social.ts +0 -29
- package/src/hooks/settings/use-list-accounts.ts +0 -39
- package/src/hooks/settings/use-list-device-sessions.ts +0 -39
- package/src/hooks/settings/use-list-sessions.ts +0 -39
- package/src/hooks/settings/use-list-user-passkeys.ts +0 -39
- package/src/hooks/settings/use-revoke-multi-session.ts +0 -39
- package/src/hooks/settings/use-revoke-session.ts +0 -39
- package/src/hooks/settings/use-set-active-session.ts +0 -58
- package/src/hooks/settings/use-unlink-account.ts +0 -37
- package/src/hooks/settings/use-update-user.ts +0 -50
- package/src/lib/auth-config.ts +0 -48
- package/src/lib/auth-context.ts +0 -6
- package/src/mutations/auth/is-username-available-options.ts +0 -18
- package/src/mutations/auth/request-password-reset-options.ts +0 -14
- package/src/mutations/auth/reset-password-options.ts +0 -14
- package/src/mutations/auth/send-verification-email-options.ts +0 -14
- package/src/mutations/auth/sign-in-email-options.ts +0 -19
- package/src/mutations/auth/sign-in-magic-link-options.ts +0 -15
- package/src/mutations/auth/sign-in-passkey-options.ts +0 -15
- package/src/mutations/auth/sign-in-social-options.ts +0 -19
- package/src/mutations/auth/sign-in-username-options.ts +0 -15
- package/src/mutations/auth/sign-out-options.ts +0 -11
- package/src/mutations/auth/sign-up-email-options.ts +0 -15
- package/src/mutations/settings/add-passkey-options.ts +0 -15
- package/src/mutations/settings/change-email-options.ts +0 -11
- package/src/mutations/settings/change-password-options.ts +0 -14
- package/src/mutations/settings/delete-passkey-options.ts +0 -15
- package/src/mutations/settings/delete-user-options.ts +0 -11
- package/src/mutations/settings/link-social-options.ts +0 -11
- package/src/mutations/settings/revoke-multi-session-options.ts +0 -15
- package/src/mutations/settings/revoke-session-options.ts +0 -14
- package/src/mutations/settings/set-active-session-options.ts +0 -15
- package/src/mutations/settings/unlink-account-options.ts +0 -14
- package/src/mutations/settings/update-user-options.ts +0 -15
- package/src/queries/auth/session-options.ts +0 -18
- package/src/queries/settings/account-info-options.ts +0 -25
- package/src/queries/settings/list-accounts-options.ts +0 -26
- package/src/queries/settings/list-device-sessions-options.ts +0 -24
- package/src/queries/settings/list-sessions-options.ts +0 -23
- package/src/queries/settings/list-user-passkeys-options.ts +0 -23
- /package/dist/components/{email → auth/email}/email-changed.d.ts +0 -0
- /package/dist/components/{email → auth/email}/email-localization.d.ts +0 -0
- /package/dist/components/{email → auth/email}/email-styles.d.ts +0 -0
- /package/dist/components/{email → auth/email}/email-verification.d.ts +0 -0
- /package/dist/components/{email → auth/email}/index.d.ts +0 -0
- /package/dist/components/{email → auth/email}/index.js +0 -0
- /package/dist/components/{email → auth/email}/magic-link.d.ts +0 -0
- /package/dist/components/{email → auth/email}/new-device.d.ts +0 -0
- /package/dist/components/{email → auth/email}/otp-email.d.ts +0 -0
- /package/dist/components/{email → auth/email}/password-changed.d.ts +0 -0
- /package/dist/components/{email → auth/email}/reset-password.d.ts +0 -0
- /package/src/components/{email → auth/email}/email-localization.tsx +0 -0
- /package/src/components/{email → auth/email}/email-styles.tsx +0 -0
- /package/src/components/{email → auth/email}/index.ts +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { sessionOptions as t } from "../../queries/auth/session-options.js";
|
|
3
|
-
import { signUpEmailOptions as n } from "../../mutations/auth/sign-up-email-options.js";
|
|
4
|
-
import { useMutation as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/auth/use-sign-up-email.ts
|
|
6
|
-
function a(a) {
|
|
7
|
-
let { authClient: o } = e(), s = i();
|
|
8
|
-
return r({
|
|
9
|
-
...n(o),
|
|
10
|
-
...a,
|
|
11
|
-
onSuccess: async (...e) => {
|
|
12
|
-
s.resetQueries({ queryKey: t(o).queryKey }), await a?.onSuccess?.(...e);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { a as useSignUpEmail };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { accountInfoOptions } from '../../queries/settings/account-info-options';
|
|
3
|
-
export type UseAccountInfoParams = NonNullable<Parameters<AuthClient["accountInfo"]>[0]>;
|
|
4
|
-
export type UseAccountInfoOptions = Omit<ReturnType<typeof accountInfoOptions>, "queryKey" | "queryFn"> & UseAccountInfoParams;
|
|
5
|
-
/**
|
|
6
|
-
* Retrieve provider-specific info for a linked account.
|
|
7
|
-
*
|
|
8
|
-
* Keyed per-user; waits for the active session and `options.query.accountId`
|
|
9
|
-
* before firing.
|
|
10
|
-
*
|
|
11
|
-
* @param options - Better Auth params (`query`, `fetchOptions`) and React
|
|
12
|
-
* Query options forwarded to `useQuery`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useAccountInfo(options?: UseAccountInfoOptions): import('@tanstack/react-query').UseQueryResult<{
|
|
15
|
-
user: import('better-auth').OAuth2UserInfo;
|
|
16
|
-
data: Record<string, any>;
|
|
17
|
-
} | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useSession as t } from "../auth/use-session.js";
|
|
3
|
-
import { accountInfoOptions as n } from "../../queries/settings/account-info-options.js";
|
|
4
|
-
import { skipToken as r, useQuery as i } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-account-info.ts
|
|
6
|
-
function a(a) {
|
|
7
|
-
let { authClient: o } = e(), { data: s } = t({ refetchOnMount: !1 }), c = s?.user.id, { query: l, fetchOptions: u, ...d } = a ?? {}, f = l?.accountId, p = !c || !f;
|
|
8
|
-
return i({
|
|
9
|
-
...n(o, c, {
|
|
10
|
-
query: l,
|
|
11
|
-
fetchOptions: u
|
|
12
|
-
}),
|
|
13
|
-
...p && { queryFn: r },
|
|
14
|
-
...d
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { a as useAccountInfo };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { addPasskeyOptions } from '../../mutations/settings/add-passkey-options';
|
|
3
|
-
export type UseAddPasskeyParams = NonNullable<Parameters<AuthClient["passkey"]["addPasskey"]>[0]>;
|
|
4
|
-
export type UseAddPasskeyOptions = Omit<ReturnType<typeof addPasskeyOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for registering a new passkey.
|
|
7
|
-
*
|
|
8
|
-
* Refetches the user's passkey list on success.
|
|
9
|
-
*
|
|
10
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
11
|
-
* @returns The `useMutation` result.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useAddPasskey(options?: UseAddPasskeyOptions): import('@tanstack/react-query').UseMutationResult<import('@better-auth/passkey/client').Passkey | null, import('better-auth/client').BetterFetchError, void | {
|
|
14
|
-
fetchOptions?: import('better-auth').ClientFetchOption;
|
|
15
|
-
name?: string;
|
|
16
|
-
authenticatorAttachment?: "platform" | "cross-platform";
|
|
17
|
-
context?: string | null;
|
|
18
|
-
extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
|
|
19
|
-
useAutoRegister?: boolean;
|
|
20
|
-
returnWebAuthnResponse?: boolean;
|
|
21
|
-
}, unknown>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { addPasskeyOptions as t } from "../../mutations/settings/add-passkey-options.js";
|
|
3
|
-
import { useListUserPasskeys as n } from "./use-list-user-passkeys.js";
|
|
4
|
-
import { useMutation as r } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-add-passkey.ts
|
|
6
|
-
function i(i) {
|
|
7
|
-
let { authClient: a } = e(), { refetch: o } = n();
|
|
8
|
-
return r({
|
|
9
|
-
...t(a),
|
|
10
|
-
...i,
|
|
11
|
-
onSuccess: async (...e) => {
|
|
12
|
-
await o(), await i?.onSuccess?.(...e);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { i as useAddPasskey };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { changeEmailOptions } from '../../mutations/settings/change-email-options';
|
|
3
|
-
export type UseChangeEmailParams = NonNullable<Parameters<AuthClient["changeEmail"]>[0]>;
|
|
4
|
-
export type UseChangeEmailOptions = Omit<ReturnType<typeof changeEmailOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for changing the current user's email address.
|
|
7
|
-
*
|
|
8
|
-
* Refetches the session on success to surface the new email.
|
|
9
|
-
*
|
|
10
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
11
|
-
* @returns The `useMutation` result.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useChangeEmail(options?: UseChangeEmailOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
14
|
-
newEmail: string;
|
|
15
|
-
callbackURL?: string | undefined;
|
|
16
|
-
} & {
|
|
17
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
18
|
-
newEmail: string;
|
|
19
|
-
callbackURL?: string | undefined;
|
|
20
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
21
|
-
}>, unknown>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useSession as t } from "../auth/use-session.js";
|
|
3
|
-
import { changeEmailOptions as n } from "../../mutations/settings/change-email-options.js";
|
|
4
|
-
import { useMutation as r } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-change-email.ts
|
|
6
|
-
function i(i) {
|
|
7
|
-
let { authClient: a } = e(), { refetch: o } = t({ refetchOnMount: !1 });
|
|
8
|
-
return r({
|
|
9
|
-
...n(a),
|
|
10
|
-
...i,
|
|
11
|
-
onSuccess: async (...e) => {
|
|
12
|
-
await o(), await i?.onSuccess?.(...e);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { i as useChangeEmail };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { changePasswordOptions } from '../../mutations/settings/change-password-options';
|
|
3
|
-
export type UseChangePasswordParams = NonNullable<Parameters<AuthClient["changePassword"]>[0]>;
|
|
4
|
-
export type UseChangePasswordOptions = Omit<ReturnType<typeof changePasswordOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for changing the authenticated user's password.
|
|
7
|
-
*
|
|
8
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
9
|
-
* @returns The `useMutation` result.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useChangePassword(options?: UseChangePasswordOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
12
|
-
newPassword: string;
|
|
13
|
-
currentPassword: string;
|
|
14
|
-
revokeOtherSessions?: boolean | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
17
|
-
newPassword: string;
|
|
18
|
-
currentPassword: string;
|
|
19
|
-
revokeOtherSessions?: boolean | undefined;
|
|
20
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
21
|
-
}>, unknown>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { changePasswordOptions as t } from "../../mutations/settings/change-password-options.js";
|
|
3
|
-
import { useMutation as n } from "@tanstack/react-query";
|
|
4
|
-
//#region src/hooks/settings/use-change-password.ts
|
|
5
|
-
function r(r) {
|
|
6
|
-
let { authClient: i } = e();
|
|
7
|
-
return n({
|
|
8
|
-
...t(i),
|
|
9
|
-
...r
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { r as useChangePassword };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { deletePasskeyOptions } from '../../mutations/settings/delete-passkey-options';
|
|
3
|
-
export type UseDeletePasskeyParams = NonNullable<Parameters<AuthClient["passkey"]["deletePasskey"]>[0]>;
|
|
4
|
-
export type UseDeletePasskeyOptions = Omit<ReturnType<typeof deletePasskeyOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for deleting a passkey.
|
|
7
|
-
*
|
|
8
|
-
* Refetches the user's passkey list on success.
|
|
9
|
-
*
|
|
10
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
11
|
-
* @returns The `useMutation` result.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useDeletePasskey(options?: UseDeletePasskeyOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
14
|
-
id: string;
|
|
15
|
-
} & {
|
|
16
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
17
|
-
id: string;
|
|
18
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
19
|
-
}>, unknown>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useListUserPasskeys as t } from "./use-list-user-passkeys.js";
|
|
3
|
-
import { deletePasskeyOptions as n } from "../../mutations/settings/delete-passkey-options.js";
|
|
4
|
-
import { useMutation as r } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-delete-passkey.ts
|
|
6
|
-
function i(i) {
|
|
7
|
-
let { authClient: a } = e(), { refetch: o } = t();
|
|
8
|
-
return r({
|
|
9
|
-
...n(a),
|
|
10
|
-
...i,
|
|
11
|
-
onSuccess: async (...e) => {
|
|
12
|
-
await o(), await i?.onSuccess?.(...e);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { i as useDeletePasskey };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { deleteUserOptions } from '../../mutations/settings/delete-user-options';
|
|
3
|
-
export type UseDeleteUserParams = NonNullable<Parameters<AuthClient["deleteUser"]>[0]>;
|
|
4
|
-
export type UseDeleteUserOptions = Omit<ReturnType<typeof deleteUserOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for deleting the authenticated user account.
|
|
7
|
-
*
|
|
8
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
9
|
-
* @returns The `useMutation` result.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useDeleteUser(options?: UseDeleteUserOptions): import('@tanstack/react-query').UseMutationResult<{
|
|
12
|
-
success: boolean;
|
|
13
|
-
message: string;
|
|
14
|
-
} | null, import('better-auth/client').BetterFetchError, void | import('better-auth').Prettify<{
|
|
15
|
-
callbackURL?: string | undefined;
|
|
16
|
-
password?: string | undefined;
|
|
17
|
-
token?: string | undefined;
|
|
18
|
-
} & {
|
|
19
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
20
|
-
callbackURL?: string | undefined;
|
|
21
|
-
password?: string | undefined;
|
|
22
|
-
token?: string | undefined;
|
|
23
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
24
|
-
}>, unknown>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { deleteUserOptions as t } from "../../mutations/settings/delete-user-options.js";
|
|
3
|
-
import { useMutation as n } from "@tanstack/react-query";
|
|
4
|
-
//#region src/hooks/settings/use-delete-user.ts
|
|
5
|
-
function r(r) {
|
|
6
|
-
let { authClient: i } = e();
|
|
7
|
-
return n({
|
|
8
|
-
...t(i),
|
|
9
|
-
...r
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { r as useDeleteUser };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { linkSocialOptions } from '../../mutations/settings/link-social-options';
|
|
3
|
-
export type UseLinkSocialParams = NonNullable<Parameters<AuthClient["linkSocial"]>[0]>;
|
|
4
|
-
export type UseLinkSocialOptions = Omit<ReturnType<typeof linkSocialOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for linking a social provider to the current user.
|
|
7
|
-
*
|
|
8
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
9
|
-
* @returns The `useMutation` result.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useLinkSocial(options?: UseLinkSocialOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
12
|
-
provider: unknown;
|
|
13
|
-
callbackURL?: string | undefined;
|
|
14
|
-
idToken?: {
|
|
15
|
-
token: string;
|
|
16
|
-
nonce?: string | undefined;
|
|
17
|
-
accessToken?: string | undefined;
|
|
18
|
-
refreshToken?: string | undefined;
|
|
19
|
-
scopes?: string[] | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
requestSignUp?: boolean | undefined;
|
|
22
|
-
scopes?: string[] | undefined;
|
|
23
|
-
errorCallbackURL?: string | undefined;
|
|
24
|
-
disableRedirect?: boolean | undefined;
|
|
25
|
-
additionalData?: Record<string, any> | undefined;
|
|
26
|
-
} & {
|
|
27
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
28
|
-
provider: unknown;
|
|
29
|
-
callbackURL?: string | undefined;
|
|
30
|
-
idToken?: {
|
|
31
|
-
token: string;
|
|
32
|
-
nonce?: string | undefined;
|
|
33
|
-
accessToken?: string | undefined;
|
|
34
|
-
refreshToken?: string | undefined;
|
|
35
|
-
scopes?: string[] | undefined;
|
|
36
|
-
} | undefined;
|
|
37
|
-
requestSignUp?: boolean | undefined;
|
|
38
|
-
scopes?: string[] | undefined;
|
|
39
|
-
errorCallbackURL?: string | undefined;
|
|
40
|
-
disableRedirect?: boolean | undefined;
|
|
41
|
-
additionalData?: Record<string, any> | undefined;
|
|
42
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
43
|
-
}>, unknown>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { linkSocialOptions as t } from "../../mutations/settings/link-social-options.js";
|
|
3
|
-
import { useMutation as n } from "@tanstack/react-query";
|
|
4
|
-
//#region src/hooks/settings/use-link-social.ts
|
|
5
|
-
function r(r) {
|
|
6
|
-
let { authClient: i } = e();
|
|
7
|
-
return n({
|
|
8
|
-
...t(i),
|
|
9
|
-
...r
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { r as useLinkSocial };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { listAccountsOptions } from '../../queries/settings/list-accounts-options';
|
|
3
|
-
export type UseListAccountsParams = NonNullable<Parameters<AuthClient["listAccounts"]>[0]>;
|
|
4
|
-
export type UseListAccountsOptions = Omit<ReturnType<typeof listAccountsOptions>, "queryKey" | "queryFn"> & UseListAccountsParams;
|
|
5
|
-
/**
|
|
6
|
-
* Retrieve the current user's linked social accounts.
|
|
7
|
-
*
|
|
8
|
-
* Keyed per-user; waits for the active session before firing.
|
|
9
|
-
*
|
|
10
|
-
* @param options - Better Auth params (`fetchOptions`) and React Query
|
|
11
|
-
* options forwarded to `useQuery`.
|
|
12
|
-
* @returns React Query result for the user's linked accounts.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useListAccounts(options?: UseListAccountsOptions): import('@tanstack/react-query').UseQueryResult<{
|
|
15
|
-
scopes: string[];
|
|
16
|
-
id: string;
|
|
17
|
-
createdAt: Date;
|
|
18
|
-
updatedAt: Date;
|
|
19
|
-
userId: string;
|
|
20
|
-
providerId: string;
|
|
21
|
-
accountId: string;
|
|
22
|
-
}[] | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useSession as t } from "../auth/use-session.js";
|
|
3
|
-
import { listAccountsOptions as n } from "../../queries/settings/list-accounts-options.js";
|
|
4
|
-
import { skipToken as r, useQuery as i } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-list-accounts.ts
|
|
6
|
-
function a(a) {
|
|
7
|
-
let { authClient: o } = e(), { data: s } = t({ refetchOnMount: !1 }), c = s?.user.id, l = !c, { fetchOptions: u, ...d } = a ?? {};
|
|
8
|
-
return i({
|
|
9
|
-
...n(o, c, { fetchOptions: u }),
|
|
10
|
-
...l && { queryFn: r },
|
|
11
|
-
...d
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { a as useListAccounts };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { listDeviceSessionsOptions } from '../../queries/settings/list-device-sessions-options';
|
|
3
|
-
export type UseListDeviceSessionsParams = NonNullable<Parameters<AuthClient["multiSession"]["listDeviceSessions"]>[0]>;
|
|
4
|
-
export type UseListDeviceSessionsOptions = Omit<ReturnType<typeof listDeviceSessionsOptions>, "queryKey" | "queryFn"> & UseListDeviceSessionsParams;
|
|
5
|
-
/**
|
|
6
|
-
* Retrieve the device sessions (multi-session account switcher).
|
|
7
|
-
*
|
|
8
|
-
* Keyed per-user; waits for the active session before firing.
|
|
9
|
-
*
|
|
10
|
-
* @param options - Better Auth params (`fetchOptions`) and React Query
|
|
11
|
-
* options forwarded to `useQuery`.
|
|
12
|
-
* @returns React Query result for the device sessions list.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useListDeviceSessions(options?: UseListDeviceSessionsOptions): import('@tanstack/react-query').UseQueryResult<{
|
|
15
|
-
session: {
|
|
16
|
-
id: string;
|
|
17
|
-
createdAt: Date;
|
|
18
|
-
updatedAt: Date;
|
|
19
|
-
userId: string;
|
|
20
|
-
expiresAt: Date;
|
|
21
|
-
token: string;
|
|
22
|
-
ipAddress?: string | null | undefined;
|
|
23
|
-
userAgent?: string | null | undefined;
|
|
24
|
-
};
|
|
25
|
-
user: {
|
|
26
|
-
id: string;
|
|
27
|
-
createdAt: Date;
|
|
28
|
-
updatedAt: Date;
|
|
29
|
-
email: string;
|
|
30
|
-
emailVerified: boolean;
|
|
31
|
-
name: string;
|
|
32
|
-
image?: string | null | undefined;
|
|
33
|
-
};
|
|
34
|
-
}[] | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useSession as t } from "../auth/use-session.js";
|
|
3
|
-
import { listDeviceSessionsOptions as n } from "../../queries/settings/list-device-sessions-options.js";
|
|
4
|
-
import { skipToken as r, useQuery as i } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-list-device-sessions.ts
|
|
6
|
-
function a(a) {
|
|
7
|
-
let { authClient: o } = e(), { data: s } = t({ refetchOnMount: !1 }), c = s?.user.id, l = !c, { fetchOptions: u, ...d } = a ?? {};
|
|
8
|
-
return i({
|
|
9
|
-
...n(o, c, { fetchOptions: u }),
|
|
10
|
-
...l && { queryFn: r },
|
|
11
|
-
...d
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { a as useListDeviceSessions };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { listSessionsOptions } from '../../queries/settings/list-sessions-options';
|
|
3
|
-
export type UseListSessionsParams = NonNullable<Parameters<AuthClient["listSessions"]>[0]>;
|
|
4
|
-
export type UseListSessionsOptions = Omit<ReturnType<typeof listSessionsOptions>, "queryKey" | "queryFn"> & UseListSessionsParams;
|
|
5
|
-
/**
|
|
6
|
-
* Retrieve the active sessions (devices where the current user is signed in).
|
|
7
|
-
*
|
|
8
|
-
* Keyed per-user; waits for the active session before firing.
|
|
9
|
-
*
|
|
10
|
-
* @param options - Better Auth params (`fetchOptions`) and React Query
|
|
11
|
-
* options forwarded to `useQuery`.
|
|
12
|
-
* @returns React Query result for the sessions list.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useListSessions(options?: UseListSessionsOptions): import('@tanstack/react-query').UseQueryResult<import('better-auth').Prettify<{
|
|
15
|
-
id: string;
|
|
16
|
-
createdAt: Date;
|
|
17
|
-
updatedAt: Date;
|
|
18
|
-
userId: string;
|
|
19
|
-
expiresAt: Date;
|
|
20
|
-
token: string;
|
|
21
|
-
ipAddress?: string | null | undefined | undefined;
|
|
22
|
-
userAgent?: string | null | undefined | undefined;
|
|
23
|
-
}>[] | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useSession as t } from "../auth/use-session.js";
|
|
3
|
-
import { listSessionsOptions as n } from "../../queries/settings/list-sessions-options.js";
|
|
4
|
-
import { skipToken as r, useQuery as i } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-list-sessions.ts
|
|
6
|
-
function a(a) {
|
|
7
|
-
let { authClient: o } = e(), { data: s } = t({ refetchOnMount: !1 }), c = s?.user.id, l = !c, { fetchOptions: u, ...d } = a ?? {};
|
|
8
|
-
return i({
|
|
9
|
-
...n(o, c, { fetchOptions: u }),
|
|
10
|
-
...l && { queryFn: r },
|
|
11
|
-
...d
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { a as useListSessions };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { listUserPasskeysOptions } from '../../queries/settings/list-user-passkeys-options';
|
|
3
|
-
export type UseListUserPasskeysParams = NonNullable<Parameters<AuthClient["passkey"]["listUserPasskeys"]>[0]>;
|
|
4
|
-
export type UseListUserPasskeysOptions = Omit<ReturnType<typeof listUserPasskeysOptions>, "queryKey" | "queryFn"> & UseListUserPasskeysParams;
|
|
5
|
-
/**
|
|
6
|
-
* Retrieve the passkeys registered for the current user.
|
|
7
|
-
*
|
|
8
|
-
* Keyed per-user; waits for the active session before firing.
|
|
9
|
-
*
|
|
10
|
-
* @param options - Better Auth params (`fetchOptions`) and React Query
|
|
11
|
-
* options forwarded to `useQuery`.
|
|
12
|
-
* @returns React Query result for the passkeys list.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useListUserPasskeys(options?: UseListUserPasskeysOptions): import('@tanstack/react-query').UseQueryResult<import('@better-auth/passkey/client').Passkey[] | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useSession as t } from "../auth/use-session.js";
|
|
3
|
-
import { listUserPasskeysOptions as n } from "../../queries/settings/list-user-passkeys-options.js";
|
|
4
|
-
import { skipToken as r, useQuery as i } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-list-user-passkeys.ts
|
|
6
|
-
function a(a) {
|
|
7
|
-
let { authClient: o } = e(), { data: s } = t({ refetchOnMount: !1 }), c = s?.user.id, l = !c, { fetchOptions: u, ...d } = a ?? {};
|
|
8
|
-
return i({
|
|
9
|
-
...n(o, c, { fetchOptions: u }),
|
|
10
|
-
...l && { queryFn: r },
|
|
11
|
-
...d
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { a as useListUserPasskeys };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { revokeMultiSessionOptions } from '../../mutations/settings/revoke-multi-session-options';
|
|
3
|
-
export type UseRevokeMultiSessionParams = NonNullable<Parameters<AuthClient["multiSession"]["revoke"]>[0]>;
|
|
4
|
-
export type UseRevokeMultiSessionOptions = Omit<ReturnType<typeof revokeMultiSessionOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for revoking a device session in multi-session mode.
|
|
7
|
-
*
|
|
8
|
-
* Refetches the device sessions list on success.
|
|
9
|
-
*
|
|
10
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
11
|
-
* @returns The `useMutation` result.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useRevokeMultiSession(options?: UseRevokeMultiSessionOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
14
|
-
sessionToken: string;
|
|
15
|
-
} & {
|
|
16
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
17
|
-
sessionToken: string;
|
|
18
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
19
|
-
}>, unknown>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useListDeviceSessions as t } from "./use-list-device-sessions.js";
|
|
3
|
-
import { revokeMultiSessionOptions as n } from "../../mutations/settings/revoke-multi-session-options.js";
|
|
4
|
-
import { useMutation as r } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-revoke-multi-session.ts
|
|
6
|
-
function i(i) {
|
|
7
|
-
let { authClient: a } = e(), { refetch: o } = t({ refetchOnMount: !1 });
|
|
8
|
-
return r({
|
|
9
|
-
...n(a),
|
|
10
|
-
...i,
|
|
11
|
-
onSuccess: async (...e) => {
|
|
12
|
-
await o(), await i?.onSuccess?.(...e);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { i as useRevokeMultiSession };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { revokeSessionOptions } from '../../mutations/settings/revoke-session-options';
|
|
3
|
-
export type UseRevokeSessionParams = NonNullable<Parameters<AuthClient["revokeSession"]>[0]>;
|
|
4
|
-
export type UseRevokeSessionOptions = Omit<ReturnType<typeof revokeSessionOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for revoking a user session.
|
|
7
|
-
*
|
|
8
|
-
* Refetches the sessions list on success.
|
|
9
|
-
*
|
|
10
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
11
|
-
* @returns The `useMutation` result.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useRevokeSession(options?: UseRevokeSessionOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
14
|
-
token: string;
|
|
15
|
-
} & {
|
|
16
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
17
|
-
token: string;
|
|
18
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
19
|
-
}>, unknown>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { useListSessions as t } from "./use-list-sessions.js";
|
|
3
|
-
import { revokeSessionOptions as n } from "../../mutations/settings/revoke-session-options.js";
|
|
4
|
-
import { useMutation as r } from "@tanstack/react-query";
|
|
5
|
-
//#region src/hooks/settings/use-revoke-session.ts
|
|
6
|
-
function i(i) {
|
|
7
|
-
let { authClient: a } = e(), { refetch: o } = t({ refetchOnMount: !1 });
|
|
8
|
-
return r({
|
|
9
|
-
...n(a),
|
|
10
|
-
...i,
|
|
11
|
-
onSuccess: async (...e) => {
|
|
12
|
-
await o(), await i?.onSuccess?.(...e);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { i as useRevokeSession };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { setActiveSessionOptions } from '../../mutations/settings/set-active-session-options';
|
|
3
|
-
export type UseSetActiveSessionParams = NonNullable<Parameters<AuthClient["multiSession"]["setActive"]>[0]>;
|
|
4
|
-
export type UseSetActiveSessionOptions = Omit<ReturnType<typeof setActiveSessionOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that sets an active device session in multi-session mode.
|
|
7
|
-
*
|
|
8
|
-
* Optimistically switches the cached session to the matching device session,
|
|
9
|
-
* scrolls to top, and refetches both the session and device-session queries.
|
|
10
|
-
*
|
|
11
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
12
|
-
* @returns The `useMutation` result.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useSetActiveSession(options?: UseSetActiveSessionOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
15
|
-
sessionToken: string;
|
|
16
|
-
} & {
|
|
17
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
18
|
-
sessionToken: string;
|
|
19
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
20
|
-
}>, unknown>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
-
import { sessionOptions as t } from "../../queries/auth/session-options.js";
|
|
3
|
-
import { useSession as n } from "../auth/use-session.js";
|
|
4
|
-
import { useListDeviceSessions as r } from "./use-list-device-sessions.js";
|
|
5
|
-
import { setActiveSessionOptions as i } from "../../mutations/settings/set-active-session-options.js";
|
|
6
|
-
import { useMutation as a, useQueryClient as o } from "@tanstack/react-query";
|
|
7
|
-
//#region src/hooks/settings/use-set-active-session.ts
|
|
8
|
-
function s(s) {
|
|
9
|
-
let c = o(), { authClient: l } = e(), { refetch: u } = n({ refetchOnMount: !1 }), { data: d, refetch: f } = r({ refetchOnMount: !1 });
|
|
10
|
-
return a({
|
|
11
|
-
...i(l),
|
|
12
|
-
...s,
|
|
13
|
-
onSuccess: async (e, n, ...r) => {
|
|
14
|
-
let i = n?.sessionToken, a = d?.find((e) => e.session.token === i);
|
|
15
|
-
a && c.setQueryData(t(l).queryKey, a), window.scrollTo({ top: 0 }), await u(), await f(), await s?.onSuccess?.(e, n, ...r);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { s as useSetActiveSession };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { unlinkAccountOptions } from '../../mutations/settings/unlink-account-options';
|
|
3
|
-
export type UseUnlinkAccountParams = NonNullable<Parameters<AuthClient["unlinkAccount"]>[0]>;
|
|
4
|
-
export type UseUnlinkAccountOptions = Omit<ReturnType<typeof unlinkAccountOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
-
/**
|
|
6
|
-
* Hook that creates a mutation for unlinking a social provider from the current user.
|
|
7
|
-
*
|
|
8
|
-
* Refetches the linked accounts list on success.
|
|
9
|
-
*
|
|
10
|
-
* @param options - React Query options forwarded to `useMutation`.
|
|
11
|
-
* @returns The `useMutation` result.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useUnlinkAccount(options?: UseUnlinkAccountOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
14
|
-
providerId: string;
|
|
15
|
-
accountId?: string | undefined;
|
|
16
|
-
} & {
|
|
17
|
-
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
18
|
-
providerId: string;
|
|
19
|
-
accountId?: string | undefined;
|
|
20
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
21
|
-
}>, unknown>;
|