@adonis-agora/authkit-react 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +92 -84
- package/build/index.js +48 -44
- package/build/src/authkit_provider.js +1 -1
- package/build/src/client/client.d.ts +1 -1
- package/build/src/client/client.js +4 -2
- package/build/src/client/context.d.ts +1 -1
- package/build/src/client/context.js +1 -1
- package/build/src/components/authenticated.js +1 -1
- package/build/src/components/can_permission.d.ts +1 -1
- package/build/src/components/can_permission.js +2 -2
- package/build/src/components/interaction_form.d.ts +3 -3
- package/build/src/components/interaction_form.js +3 -3
- package/build/src/components/key_rotation.js +1 -1
- package/build/src/components/magic_link_button.d.ts +2 -2
- package/build/src/components/magic_link_button.js +7 -7
- package/build/src/components/oauth_button.d.ts +2 -2
- package/build/src/components/oauth_button.js +5 -5
- package/build/src/components/organization_profile.js +3 -3
- package/build/src/components/passkey_button.d.ts +2 -2
- package/build/src/components/passkey_button.js +9 -9
- package/build/src/components/password_strength_meter.js +1 -4
- package/build/src/components/user_button.js +1 -1
- package/build/src/components/user_profile.js +1 -1
- package/build/src/config.d.ts +1 -1
- package/build/src/config.js +16 -19
- package/build/src/hooks/use_can.js +8 -8
- package/build/src/hooks/use_organization.js +3 -1
- package/build/src/hooks/use_passkey_assertion.d.ts +12 -0
- package/build/src/hooks/use_passkey_assertion.js +19 -0
- package/build/src/hooks/use_passkey_autofill.js +10 -11
- package/build/src/hooks/use_passkey_login.js +2 -2
- package/build/src/hooks/use_passkey_registration.d.ts +12 -0
- package/build/src/hooks/use_passkey_registration.js +19 -0
- package/build/src/hooks/use_profile.d.ts +1 -1
- package/build/src/hooks/use_profile.js +5 -1
- package/build/src/hooks/use_resource.js +1 -1
- package/build/src/hooks/use_sign_in.js +1 -1
- package/build/src/hooks/use_sign_out.js +1 -1
- package/build/src/interaction/urls.d.ts +1 -1
- package/build/src/interaction/urls.js +2 -2
- package/build/src/passkey/authenticate.d.ts +20 -1
- package/build/src/passkey/authenticate.js +51 -31
- package/build/src/passkey/classic_form.d.ts +9 -0
- package/build/src/passkey/classic_form.js +18 -0
- package/build/src/passkey/sudo.d.ts +12 -0
- package/build/src/passkey/sudo.js +20 -0
- package/build/src/queries/account/index.d.ts +1 -1
- package/build/src/queries/admin/index.d.ts +1 -1
- package/build/src/use_auth.js +1 -1
- package/build/src/utils.js +6 -6
- package/package.json +7 -1
package/build/index.d.ts
CHANGED
|
@@ -1,84 +1,92 @@
|
|
|
1
|
-
export { useAuth } from
|
|
2
|
-
export { AuthProvider, AuthContext } from
|
|
3
|
-
export type { AuthProviderProps } from
|
|
4
|
-
export { AuthkitProvider } from
|
|
5
|
-
export type { AuthkitProviderProps } from
|
|
6
|
-
export { AuthkitConfigContext, useAuthkitConfig, resolveConfig, buildAuthUrl, DEFAULT_CONFIG, } from
|
|
7
|
-
export type { AuthkitConfig, ResolvedAuthkitConfig, AuthkitEndpoints, AuthkitIdpMode, } from
|
|
8
|
-
export { useSignIn } from
|
|
9
|
-
export type { SignInOptions } from
|
|
10
|
-
export { useSignOut } from
|
|
11
|
-
export type { SignOutOptions } from
|
|
12
|
-
export { useUser } from
|
|
13
|
-
export type { UseUserResult } from
|
|
14
|
-
export { useProfile } from
|
|
15
|
-
export type { UseProfileResult, ProfileUpdate, } from
|
|
16
|
-
export { useSessions } from
|
|
17
|
-
export type { UseSessionsResult, AuthSession, } from
|
|
18
|
-
export { useAuthorizedApps } from
|
|
19
|
-
export type { UseAuthorizedAppsResult, AuthorizedApp, } from
|
|
20
|
-
export { useOrganizations } from
|
|
21
|
-
export type { UseOrganizationsResult, OrgEntry, } from
|
|
22
|
-
export { useOrganization } from
|
|
23
|
-
export type { UseOrganizationResult, ActiveOrgDetail, OrgMemberEntry, } from
|
|
24
|
-
export { useSwitchOrganization } from
|
|
25
|
-
export type { UseSwitchOrganizationResult } from
|
|
26
|
-
export { useOrgInvitations } from
|
|
27
|
-
export type { UseOrgInvitationsResult, OrgInvitationEntry, } from
|
|
28
|
-
export { jsonRequest, useResource } from
|
|
29
|
-
export type { ResourceState } from
|
|
30
|
-
export { usePasskeyAutofill } from
|
|
31
|
-
export type { UsePasskeyAutofillOptions } from
|
|
32
|
-
export { usePasskeyLogin } from
|
|
33
|
-
export type { UsePasskeyLoginOptions, UsePasskeyLoginResult, } from
|
|
34
|
-
export { authenticatePasskey, submitPasskeyVerification, loadStartAuthentication, } from
|
|
35
|
-
export type { AuthenticatePasskeyOptions, SubmitPasskeyVerificationOptions, PasskeyCeremonyDeps, StartAuthenticationFn, } from
|
|
36
|
-
export {
|
|
37
|
-
export type {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export
|
|
41
|
-
export {
|
|
42
|
-
export
|
|
43
|
-
export {
|
|
44
|
-
export
|
|
45
|
-
export {
|
|
46
|
-
export
|
|
47
|
-
export {
|
|
48
|
-
export type {
|
|
49
|
-
export {
|
|
50
|
-
export type {
|
|
51
|
-
export {
|
|
52
|
-
export type {
|
|
53
|
-
export {
|
|
54
|
-
export type {
|
|
55
|
-
export {
|
|
56
|
-
export type {
|
|
57
|
-
export {
|
|
58
|
-
export type {
|
|
59
|
-
export {
|
|
60
|
-
export type {
|
|
61
|
-
export {
|
|
62
|
-
export type {
|
|
63
|
-
export {
|
|
64
|
-
export type {
|
|
65
|
-
export {
|
|
66
|
-
export type {
|
|
67
|
-
export {
|
|
68
|
-
export type {
|
|
69
|
-
export {
|
|
70
|
-
export type {
|
|
71
|
-
export {
|
|
72
|
-
export type {
|
|
73
|
-
export {
|
|
74
|
-
export type {
|
|
75
|
-
export {
|
|
76
|
-
export type {
|
|
77
|
-
export {
|
|
78
|
-
export type {
|
|
79
|
-
export
|
|
80
|
-
export {
|
|
81
|
-
export
|
|
82
|
-
export {
|
|
83
|
-
export {
|
|
84
|
-
export {
|
|
1
|
+
export { useAuth } from './src/use_auth.js';
|
|
2
|
+
export { AuthProvider, AuthContext } from './src/provider.js';
|
|
3
|
+
export type { AuthProviderProps } from './src/provider.js';
|
|
4
|
+
export { AuthkitProvider } from './src/authkit_provider.js';
|
|
5
|
+
export type { AuthkitProviderProps } from './src/authkit_provider.js';
|
|
6
|
+
export { AuthkitConfigContext, useAuthkitConfig, resolveConfig, buildAuthUrl, DEFAULT_CONFIG, } from './src/config.js';
|
|
7
|
+
export type { AuthkitConfig, ResolvedAuthkitConfig, AuthkitEndpoints, AuthkitIdpMode, } from './src/config.js';
|
|
8
|
+
export { useSignIn } from './src/hooks/use_sign_in.js';
|
|
9
|
+
export type { SignInOptions } from './src/hooks/use_sign_in.js';
|
|
10
|
+
export { useSignOut } from './src/hooks/use_sign_out.js';
|
|
11
|
+
export type { SignOutOptions } from './src/hooks/use_sign_out.js';
|
|
12
|
+
export { useUser } from './src/hooks/use_user.js';
|
|
13
|
+
export type { UseUserResult } from './src/hooks/use_user.js';
|
|
14
|
+
export { useProfile } from './src/hooks/use_profile.js';
|
|
15
|
+
export type { UseProfileResult, ProfileUpdate, } from './src/hooks/use_profile.js';
|
|
16
|
+
export { useSessions } from './src/hooks/use_sessions.js';
|
|
17
|
+
export type { UseSessionsResult, AuthSession, } from './src/hooks/use_sessions.js';
|
|
18
|
+
export { useAuthorizedApps } from './src/hooks/use_authorized_apps.js';
|
|
19
|
+
export type { UseAuthorizedAppsResult, AuthorizedApp, } from './src/hooks/use_authorized_apps.js';
|
|
20
|
+
export { useOrganizations } from './src/hooks/use_organizations.js';
|
|
21
|
+
export type { UseOrganizationsResult, OrgEntry, } from './src/hooks/use_organizations.js';
|
|
22
|
+
export { useOrganization } from './src/hooks/use_organization.js';
|
|
23
|
+
export type { UseOrganizationResult, ActiveOrgDetail, OrgMemberEntry, } from './src/hooks/use_organization.js';
|
|
24
|
+
export { useSwitchOrganization } from './src/hooks/use_switch_organization.js';
|
|
25
|
+
export type { UseSwitchOrganizationResult } from './src/hooks/use_switch_organization.js';
|
|
26
|
+
export { useOrgInvitations } from './src/hooks/use_org_invitations.js';
|
|
27
|
+
export type { UseOrgInvitationsResult, OrgInvitationEntry, } from './src/hooks/use_org_invitations.js';
|
|
28
|
+
export { jsonRequest, useResource } from './src/hooks/use_resource.js';
|
|
29
|
+
export type { ResourceState } from './src/hooks/use_resource.js';
|
|
30
|
+
export { usePasskeyAutofill } from './src/hooks/use_passkey_autofill.js';
|
|
31
|
+
export type { UsePasskeyAutofillOptions } from './src/hooks/use_passkey_autofill.js';
|
|
32
|
+
export { usePasskeyLogin } from './src/hooks/use_passkey_login.js';
|
|
33
|
+
export type { UsePasskeyLoginOptions, UsePasskeyLoginResult, } from './src/hooks/use_passkey_login.js';
|
|
34
|
+
export { authenticatePasskey, registerPasskey, submitPasskeyVerification, loadStartAuthentication, loadStartRegistration, } from './src/passkey/authenticate.js';
|
|
35
|
+
export type { AuthenticatePasskeyOptions, RegisterPasskeyOptions, SubmitPasskeyVerificationOptions, PasskeyCeremonyDeps, PasskeyRegistrationDeps, StartAuthenticationFn, StartRegistrationFn, } from './src/passkey/authenticate.js';
|
|
36
|
+
export { submitClassicForm } from './src/passkey/classic_form.js';
|
|
37
|
+
export type { SubmitClassicFormOptions, SubmitClassicFormDeps, } from './src/passkey/classic_form.js';
|
|
38
|
+
export { runPasskeyAssertion, runPasskeyRegistration } from './src/passkey/sudo.js';
|
|
39
|
+
export type { RunPasskeyFlowOptions, RunPasskeyAssertionDeps, RunPasskeyRegistrationDeps, } from './src/passkey/sudo.js';
|
|
40
|
+
export { usePasskeyAssertion } from './src/hooks/use_passkey_assertion.js';
|
|
41
|
+
export type { UsePasskeyAssertionOptions, UsePasskeyAssertionResult, } from './src/hooks/use_passkey_assertion.js';
|
|
42
|
+
export { usePasskeyRegistration } from './src/hooks/use_passkey_registration.js';
|
|
43
|
+
export type { UsePasskeyRegistrationOptions, UsePasskeyRegistrationResult, } from './src/hooks/use_passkey_registration.js';
|
|
44
|
+
export { usePasswordStrength, heuristicScorer, } from './src/hooks/use_password_strength.js';
|
|
45
|
+
export type { PasswordStrengthScore, PasswordStrengthResult, PasswordScorer, UsePasswordStrengthOptions, } from './src/hooks/use_password_strength.js';
|
|
46
|
+
export { deriveInitials, currentUrl, buttonClass } from './src/utils.js';
|
|
47
|
+
export { interactionUrls, oauthRedirectUrl } from './src/interaction/urls.js';
|
|
48
|
+
export type { InteractionUrls, InteractionPostStep, } from './src/interaction/urls.js';
|
|
49
|
+
export { Authenticated, Guest } from './src/components/authenticated.js';
|
|
50
|
+
export type { AuthenticatedProps, GuestProps, } from './src/components/authenticated.js';
|
|
51
|
+
export { CanPermission } from './src/components/can_permission.js';
|
|
52
|
+
export type { CanPermissionProps } from './src/components/can_permission.js';
|
|
53
|
+
export { useCan, checkCan, invalidateCanCache } from './src/hooks/use_can.js';
|
|
54
|
+
export type { UseCanResult } from './src/hooks/use_can.js';
|
|
55
|
+
export { SignInButton } from './src/components/sign_in_button.js';
|
|
56
|
+
export type { SignInButtonProps } from './src/components/sign_in_button.js';
|
|
57
|
+
export { SignOutButton } from './src/components/sign_out_button.js';
|
|
58
|
+
export type { SignOutButtonProps } from './src/components/sign_out_button.js';
|
|
59
|
+
export { Avatar } from './src/components/avatar.js';
|
|
60
|
+
export type { AvatarProps } from './src/components/avatar.js';
|
|
61
|
+
export { UserButton } from './src/components/user_button.js';
|
|
62
|
+
export type { UserButtonProps } from './src/components/user_button.js';
|
|
63
|
+
export { UserProfile } from './src/components/user_profile.js';
|
|
64
|
+
export type { UserProfileProps } from './src/components/user_profile.js';
|
|
65
|
+
export { AuthorizedApps } from './src/components/authorized_apps.js';
|
|
66
|
+
export type { AuthorizedAppsProps } from './src/components/authorized_apps.js';
|
|
67
|
+
export { PasswordStrengthMeter } from './src/components/password_strength_meter.js';
|
|
68
|
+
export type { PasswordStrengthMeterProps } from './src/components/password_strength_meter.js';
|
|
69
|
+
export { PasskeyButton } from './src/components/passkey_button.js';
|
|
70
|
+
export type { PasskeyButtonProps } from './src/components/passkey_button.js';
|
|
71
|
+
export { InteractionForm } from './src/components/interaction_form.js';
|
|
72
|
+
export type { InteractionFormProps } from './src/components/interaction_form.js';
|
|
73
|
+
export { MagicLinkButton } from './src/components/magic_link_button.js';
|
|
74
|
+
export type { MagicLinkButtonProps } from './src/components/magic_link_button.js';
|
|
75
|
+
export { OAuthButton } from './src/components/oauth_button.js';
|
|
76
|
+
export type { OAuthButtonProps } from './src/components/oauth_button.js';
|
|
77
|
+
export { OrganizationSwitcher } from './src/components/organization_switcher.js';
|
|
78
|
+
export type { OrganizationSwitcherProps } from './src/components/organization_switcher.js';
|
|
79
|
+
export { OrganizationProfile } from './src/components/organization_profile.js';
|
|
80
|
+
export type { OrganizationProfileProps } from './src/components/organization_profile.js';
|
|
81
|
+
export { KeyRotation } from './src/components/key_rotation.js';
|
|
82
|
+
export type { KeyRotationProps } from './src/components/key_rotation.js';
|
|
83
|
+
export { hasGlobalRole, hasAnyGlobalRole, hasAllGlobalRoles, } from './src/roles.js';
|
|
84
|
+
export type { AuthUser, AuthSharedProps, AuthState } from './src/types.js';
|
|
85
|
+
export { createAuthkitClient, AuthkitClientError, } from './src/client/client.js';
|
|
86
|
+
export type { AuthkitClient, AuthkitClientOptions, } from './src/client/client.js';
|
|
87
|
+
export type { AdminUser, AdminUserListResult, CreateUserInput, UpdateUserInput, UserSessionsResult, RevokeSessionsResult, AdminSessionEntry, AdminGrantEntry, AdminClient, AdminClientListResult, CreatedClientResult, RegenerateSecretResult, CreateClientInput, UpdateClientInput, RoleCatalogEntry, RoleListResult, CreateRoleInput, UpdateRoleInput, AdminOrgEntry, AdminOrgMember, AdminOrgInvitation, AdminOrgDetail, AdminOrgListResult, CreateOrgInput, UpdateOrgInput, AuditEventEntry, AuditListResult, AuditListParams, SettingEntry, SettingListResult, ImpersonationPanel, DailyPoint, AdminOverview, AccountCapabilities, AccountMe, AccountSecurityOverview, AccountSessionEntry, AccountSessionsResult, RevokeSessionResult, RevokeOthersResult, RevokeAllResult, AccountAppEntry, AccountAppsResult, RevokeAppResult, PasskeySummaryEntry, AccountMfaStatus, AccountPasskeysResult, RemovePasskeyResult, PatEntry, CreatedPatResult, AccountTokensResult, CreateTokenInput, RevokeTokenResult, UpdateProfileInput, UpdateProfileResult, ChangePasswordInput, RequestEmailChangeInput, OkResult, EmailChangeResult, AccountOrgEntry, AccountOrgsResult, AccountOrgDetail, AccountOrgInvitationsResult, ApiErrorBody, KeysStatus, ManagedKeyInfo, KeysRotateInput, KeysRotateResult, } from './src/client/types.js';
|
|
88
|
+
export { AuthkitClientProvider, useAuthkitClient, createAuthkitQueryClient, } from './src/client/context.js';
|
|
89
|
+
export type { AuthkitClientProviderProps } from './src/client/context.js';
|
|
90
|
+
export { authkitKeys } from './src/queries/keys.js';
|
|
91
|
+
export { useOverviewQueryOptions, useUsersQueryOptions, useUserQueryOptions, useUserSessionsQueryOptions, useCreateUserMutationOptions, useUpdateUserMutationOptions, useDisableUserMutationOptions, useEnableUserMutationOptions, useResetPasswordMutationOptions, useDeleteUserMutationOptions, useRevokeUserSessionsMutationOptions, useSessionsQueryOptions, useRevokeAllSessionsMutationOptions, useClientsQueryOptions, useClientQueryOptions, useCreateClientMutationOptions, useUpdateClientMutationOptions, useDeleteClientMutationOptions, useRegenerateClientSecretMutationOptions, useRolesQueryOptions, useCreateRoleMutationOptions, useUpdateRoleMutationOptions, useDeleteRoleMutationOptions, useOrgsQueryOptions, useOrgQueryOptions, useCreateOrgMutationOptions, useUpdateOrgMutationOptions, useDeleteOrgMutationOptions, useAddOrgMemberMutationOptions, useRemoveOrgMemberMutationOptions, useUpdateOrgMemberRoleMutationOptions, useCreateOrgInvitationMutationOptions, useRevokeOrgInvitationMutationOptions, useAuditQueryOptions, useSettingsQueryOptions, useSetSettingMutationOptions, useRemoveSettingMutationOptions, useImpersonationQueryOptions, useKeysQueryOptions, useRotateKeysMutationOptions, } from './src/queries/admin/index.js';
|
|
92
|
+
export { useMeQueryOptions, useSecurityQueryOptions, useUpdateProfileMutationOptions, useChangePasswordMutationOptions, useEmailChangeMutationOptions, useCancelEmailChangeMutationOptions, useAccountSessionsQueryOptions, useRevokeSessionMutationOptions, useRevokeOtherSessionsMutationOptions, useAccountRevokeAllSessionsMutationOptions, useAppsQueryOptions, useRevokeAppMutationOptions, useMfaQueryOptions, usePasskeysQueryOptions, useRemovePasskeyMutationOptions, useTokensQueryOptions, useCreateTokenMutationOptions, useRevokeTokenMutationOptions, useAccountOrgsQueryOptions, useAccountOrgQueryOptions, useAccountOrgInvitationsQueryOptions, } from './src/queries/account/index.js';
|
package/build/index.js
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
1
|
-
export { useAuth } from
|
|
2
|
-
export { AuthProvider, AuthContext } from
|
|
3
|
-
export { AuthkitProvider } from
|
|
4
|
-
export { AuthkitConfigContext, useAuthkitConfig, resolveConfig, buildAuthUrl, DEFAULT_CONFIG, } from
|
|
5
|
-
export { useSignIn } from
|
|
6
|
-
export { useSignOut } from
|
|
7
|
-
export { useUser } from
|
|
8
|
-
export { useProfile } from
|
|
9
|
-
export { useSessions } from
|
|
10
|
-
export { useAuthorizedApps } from
|
|
11
|
-
export { useOrganizations } from
|
|
12
|
-
export { useOrganization } from
|
|
13
|
-
export { useSwitchOrganization } from
|
|
14
|
-
export { useOrgInvitations } from
|
|
15
|
-
export { jsonRequest, useResource } from
|
|
16
|
-
export { usePasskeyAutofill } from
|
|
17
|
-
export { usePasskeyLogin } from
|
|
18
|
-
export { authenticatePasskey, submitPasskeyVerification, loadStartAuthentication, } from
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
1
|
+
export { useAuth } from './src/use_auth.js';
|
|
2
|
+
export { AuthProvider, AuthContext } from './src/provider.js';
|
|
3
|
+
export { AuthkitProvider } from './src/authkit_provider.js';
|
|
4
|
+
export { AuthkitConfigContext, useAuthkitConfig, resolveConfig, buildAuthUrl, DEFAULT_CONFIG, } from './src/config.js';
|
|
5
|
+
export { useSignIn } from './src/hooks/use_sign_in.js';
|
|
6
|
+
export { useSignOut } from './src/hooks/use_sign_out.js';
|
|
7
|
+
export { useUser } from './src/hooks/use_user.js';
|
|
8
|
+
export { useProfile } from './src/hooks/use_profile.js';
|
|
9
|
+
export { useSessions } from './src/hooks/use_sessions.js';
|
|
10
|
+
export { useAuthorizedApps } from './src/hooks/use_authorized_apps.js';
|
|
11
|
+
export { useOrganizations } from './src/hooks/use_organizations.js';
|
|
12
|
+
export { useOrganization } from './src/hooks/use_organization.js';
|
|
13
|
+
export { useSwitchOrganization } from './src/hooks/use_switch_organization.js';
|
|
14
|
+
export { useOrgInvitations } from './src/hooks/use_org_invitations.js';
|
|
15
|
+
export { jsonRequest, useResource } from './src/hooks/use_resource.js';
|
|
16
|
+
export { usePasskeyAutofill } from './src/hooks/use_passkey_autofill.js';
|
|
17
|
+
export { usePasskeyLogin } from './src/hooks/use_passkey_login.js';
|
|
18
|
+
export { authenticatePasskey, registerPasskey, submitPasskeyVerification, loadStartAuthentication, loadStartRegistration, } from './src/passkey/authenticate.js';
|
|
19
|
+
export { submitClassicForm } from './src/passkey/classic_form.js';
|
|
20
|
+
export { runPasskeyAssertion, runPasskeyRegistration } from './src/passkey/sudo.js';
|
|
21
|
+
export { usePasskeyAssertion } from './src/hooks/use_passkey_assertion.js';
|
|
22
|
+
export { usePasskeyRegistration } from './src/hooks/use_passkey_registration.js';
|
|
23
|
+
export { usePasswordStrength, heuristicScorer, } from './src/hooks/use_password_strength.js';
|
|
24
|
+
export { deriveInitials, currentUrl, buttonClass } from './src/utils.js';
|
|
25
|
+
export { interactionUrls, oauthRedirectUrl } from './src/interaction/urls.js';
|
|
26
|
+
export { Authenticated, Guest } from './src/components/authenticated.js';
|
|
27
|
+
export { CanPermission } from './src/components/can_permission.js';
|
|
28
|
+
export { useCan, checkCan, invalidateCanCache } from './src/hooks/use_can.js';
|
|
29
|
+
export { SignInButton } from './src/components/sign_in_button.js';
|
|
30
|
+
export { SignOutButton } from './src/components/sign_out_button.js';
|
|
31
|
+
export { Avatar } from './src/components/avatar.js';
|
|
32
|
+
export { UserButton } from './src/components/user_button.js';
|
|
33
|
+
export { UserProfile } from './src/components/user_profile.js';
|
|
34
|
+
export { AuthorizedApps } from './src/components/authorized_apps.js';
|
|
35
|
+
export { PasswordStrengthMeter } from './src/components/password_strength_meter.js';
|
|
36
|
+
export { PasskeyButton } from './src/components/passkey_button.js';
|
|
37
|
+
export { InteractionForm } from './src/components/interaction_form.js';
|
|
38
|
+
export { MagicLinkButton } from './src/components/magic_link_button.js';
|
|
39
|
+
export { OAuthButton } from './src/components/oauth_button.js';
|
|
40
|
+
export { OrganizationSwitcher } from './src/components/organization_switcher.js';
|
|
41
|
+
export { OrganizationProfile } from './src/components/organization_profile.js';
|
|
42
|
+
export { KeyRotation } from './src/components/key_rotation.js';
|
|
43
|
+
export { hasGlobalRole, hasAnyGlobalRole, hasAllGlobalRoles, } from './src/roles.js';
|
|
44
|
+
export { createAuthkitClient, AuthkitClientError, } from './src/client/client.js';
|
|
45
|
+
export { AuthkitClientProvider, useAuthkitClient, createAuthkitQueryClient, } from './src/client/context.js';
|
|
46
|
+
export { authkitKeys } from './src/queries/keys.js';
|
|
47
|
+
export { useOverviewQueryOptions, useUsersQueryOptions, useUserQueryOptions, useUserSessionsQueryOptions, useCreateUserMutationOptions, useUpdateUserMutationOptions, useDisableUserMutationOptions, useEnableUserMutationOptions, useResetPasswordMutationOptions, useDeleteUserMutationOptions, useRevokeUserSessionsMutationOptions, useSessionsQueryOptions, useRevokeAllSessionsMutationOptions, useClientsQueryOptions, useClientQueryOptions, useCreateClientMutationOptions, useUpdateClientMutationOptions, useDeleteClientMutationOptions, useRegenerateClientSecretMutationOptions, useRolesQueryOptions, useCreateRoleMutationOptions, useUpdateRoleMutationOptions, useDeleteRoleMutationOptions, useOrgsQueryOptions, useOrgQueryOptions, useCreateOrgMutationOptions, useUpdateOrgMutationOptions, useDeleteOrgMutationOptions, useAddOrgMemberMutationOptions, useRemoveOrgMemberMutationOptions, useUpdateOrgMemberRoleMutationOptions, useCreateOrgInvitationMutationOptions, useRevokeOrgInvitationMutationOptions, useAuditQueryOptions, useSettingsQueryOptions, useSetSettingMutationOptions, useRemoveSettingMutationOptions, useImpersonationQueryOptions, useKeysQueryOptions, useRotateKeysMutationOptions, } from './src/queries/admin/index.js';
|
|
48
|
+
export { useMeQueryOptions, useSecurityQueryOptions, useUpdateProfileMutationOptions, useChangePasswordMutationOptions, useEmailChangeMutationOptions, useCancelEmailChangeMutationOptions, useAccountSessionsQueryOptions, useRevokeSessionMutationOptions, useRevokeOtherSessionsMutationOptions, useAccountRevokeAllSessionsMutationOptions, useAppsQueryOptions, useRevokeAppMutationOptions, useMfaQueryOptions, usePasskeysQueryOptions, useRemovePasskeyMutationOptions, useTokensQueryOptions, useCreateTokenMutationOptions, useRevokeTokenMutationOptions, useAccountOrgsQueryOptions, useAccountOrgQueryOptions, useAccountOrgInvitationsQueryOptions, } from './src/queries/account/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import { AuthContext } from './provider.js';
|
|
3
2
|
import { AuthkitConfigContext, resolveConfig } from './config.js';
|
|
3
|
+
import { AuthContext } from './provider.js';
|
|
4
4
|
export function AuthkitProvider({ config, value, children }) {
|
|
5
5
|
const resolved = resolveConfig(config);
|
|
6
6
|
const tree = createElement(AuthkitConfigContext.Provider, { value: resolved }, children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AccountAppsResult, AccountMe, AccountMfaStatus, AccountOrgDetail, AccountOrgInvitationsResult, AccountOrgsResult, AccountPasskeysResult, AccountSecurityOverview, AccountSessionsResult, AccountTokensResult, AdminClient, AdminClientListResult, AdminOrgDetail, AdminOrgEntry, AdminOrgInvitation, AdminOrgListResult, AdminOverview, AdminUser, AdminUserListResult, AuditListParams, AuditListResult, ChangePasswordInput, CreateClientInput, CreateOrgInput, CreateRoleInput, CreateTokenInput, CreateUserInput, CreatedClientResult, CreatedPatResult, EmailChangeResult, ImpersonationPanel, KeysRotateInput, KeysRotateResult, KeysStatus, OkResult, RegenerateSecretResult, RemovePasskeyResult, RequestEmailChangeInput, RevokeAllResult, RevokeAppResult, RevokeOthersResult, RevokeSessionResult, RevokeSessionsResult, RevokeTokenResult, RoleCatalogEntry, RoleListResult, SettingEntry, SettingListResult, UpdateClientInput, UpdateOrgInput, UpdateProfileInput, UpdateProfileResult, UpdateRoleInput, UpdateUserInput, UserSessionsResult } from './types.js';
|
|
2
2
|
export declare class AuthkitClientError extends Error {
|
|
3
3
|
readonly status: number;
|
|
4
4
|
readonly code?: string | undefined;
|
|
@@ -81,7 +81,7 @@ class AuthkitClient {
|
|
|
81
81
|
throw new AuthkitClientError(res.status, message, code, parsed);
|
|
82
82
|
}
|
|
83
83
|
const text = await res.text();
|
|
84
|
-
return
|
|
84
|
+
return text ? JSON.parse(text) : null;
|
|
85
85
|
}
|
|
86
86
|
get(path, params) {
|
|
87
87
|
const qs = params ? toQueryString(params) : '';
|
|
@@ -164,7 +164,9 @@ class AuthkitClient {
|
|
|
164
164
|
},
|
|
165
165
|
set: (key, value, orgId) => {
|
|
166
166
|
const qs = orgId ? `?organizationId=${encodeURIComponent(orgId)}` : '';
|
|
167
|
-
return this.put(this.b(`/settings/${encodeURIComponent(key)}${qs}`), {
|
|
167
|
+
return this.put(this.b(`/settings/${encodeURIComponent(key)}${qs}`), {
|
|
168
|
+
value,
|
|
169
|
+
});
|
|
168
170
|
},
|
|
169
171
|
remove: (key, orgId) => {
|
|
170
172
|
const qs = orgId ? `?organizationId=${encodeURIComponent(orgId)}` : '';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { type AuthkitClient, type AuthkitClientOptions } from './client.js';
|
|
4
4
|
export declare function useAuthkitClient(): AuthkitClient;
|
|
5
5
|
export interface AuthkitClientProviderProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext, createElement, useContext } from 'react';
|
|
2
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { createContext, createElement, useContext } from 'react';
|
|
3
3
|
import { createAuthkitClient } from './client.js';
|
|
4
4
|
const AuthkitClientContext = createContext(null);
|
|
5
5
|
export function useAuthkitClient() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCan } from
|
|
1
|
+
import { Fragment, createElement } from 'react';
|
|
2
|
+
import { useCan } from '../hooks/use_can.js';
|
|
3
3
|
export function CanPermission({ children, permission, resource, loadingFallback = null, fallback = null, }) {
|
|
4
4
|
const { allowed, loading } = useCan(permission, resource);
|
|
5
5
|
const out = loading ? loadingFallback : allowed ? children : fallback;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type FormHTMLAttributes, type ReactNode } from
|
|
2
|
-
import { type InteractionPostStep } from
|
|
3
|
-
export interface InteractionFormProps extends Omit<FormHTMLAttributes<HTMLFormElement>,
|
|
1
|
+
import { type FormHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type InteractionPostStep } from '../interaction/urls.js';
|
|
3
|
+
export interface InteractionFormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, 'method' | 'action'> {
|
|
4
4
|
uid: string;
|
|
5
5
|
step: InteractionPostStep;
|
|
6
6
|
csrfToken: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createElement } from
|
|
2
|
-
import { interactionUrls
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { interactionUrls } from '../interaction/urls.js';
|
|
3
3
|
export function InteractionForm({ uid, step, csrfToken, basePath, children, ...rest }) {
|
|
4
4
|
const action = interactionUrls(uid, basePath)[step];
|
|
5
|
-
return createElement(
|
|
5
|
+
return createElement('form', { method: 'POST', action, ...rest }, createElement('input', { type: 'hidden', name: '_csrf', value: csrfToken }), children);
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
1
2
|
import { createElement, useState } from 'react';
|
|
2
|
-
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { useKeysQueryOptions, useRotateKeysMutationOptions } from '../queries/admin/index.js';
|
|
4
4
|
import { authkitKeys } from '../queries/keys.js';
|
|
5
5
|
function KeyRotationInner({ className }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes, type ReactNode } from
|
|
2
|
-
export interface MagicLinkButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface MagicLinkButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
3
3
|
uid: string;
|
|
4
4
|
csrfToken: string;
|
|
5
5
|
basePath?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createElement
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export function MagicLinkButton({ uid, csrfToken, basePath, children =
|
|
5
|
-
return createElement(InteractionForm, { uid, step:
|
|
6
|
-
type:
|
|
7
|
-
className: buttonClass(
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { buttonClass } from '../utils.js';
|
|
3
|
+
import { InteractionForm } from './interaction_form.js';
|
|
4
|
+
export function MagicLinkButton({ uid, csrfToken, basePath, children = 'Enviar link de login', className, ...rest }) {
|
|
5
|
+
return createElement(InteractionForm, { uid, step: 'magic', csrfToken, basePath }, createElement('button', {
|
|
6
|
+
type: 'submit',
|
|
7
|
+
className: buttonClass('authkit-button--ghost', className),
|
|
8
8
|
...rest,
|
|
9
9
|
}, children));
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AnchorHTMLAttributes, type ReactNode } from
|
|
2
|
-
export interface OAuthButtonProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
1
|
+
import { type AnchorHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface OAuthButtonProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
3
3
|
provider: string;
|
|
4
4
|
uid: string;
|
|
5
5
|
basePath?: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createElement
|
|
2
|
-
import { oauthRedirectUrl } from
|
|
3
|
-
import { buttonClass } from
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { oauthRedirectUrl } from '../interaction/urls.js';
|
|
3
|
+
import { buttonClass } from '../utils.js';
|
|
4
4
|
function capitalize(value) {
|
|
5
5
|
return value ? value[0].toUpperCase() + value.slice(1) : value;
|
|
6
6
|
}
|
|
7
7
|
export function OAuthButton({ provider, uid, basePath, children, className, ...rest }) {
|
|
8
|
-
return createElement(
|
|
8
|
+
return createElement('a', {
|
|
9
9
|
href: oauthRedirectUrl(provider, uid, basePath),
|
|
10
|
-
className: buttonClass(
|
|
10
|
+
className: buttonClass('authkit-button--ghost', className),
|
|
11
11
|
...rest,
|
|
12
12
|
}, children ?? `Entrar com ${capitalize(provider)}`);
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement, useState } from 'react';
|
|
3
|
-
import { useOrganizations } from '../hooks/use_organizations.js';
|
|
4
|
-
import { useOrganization } from '../hooks/use_organization.js';
|
|
5
|
-
import { useAuth } from '../use_auth.js';
|
|
6
3
|
import { useAuthkitConfig } from '../config.js';
|
|
4
|
+
import { useOrganization } from '../hooks/use_organization.js';
|
|
5
|
+
import { useOrganizations } from '../hooks/use_organizations.js';
|
|
7
6
|
import { jsonRequest } from '../hooks/use_resource.js';
|
|
7
|
+
import { useAuth } from '../use_auth.js';
|
|
8
8
|
function OrganizationProfileInner({ inviteLabel = 'Convidar membro', leaveLabel = 'Sair da organização', className, }) {
|
|
9
9
|
const { isAuthenticated } = useAuth();
|
|
10
10
|
const config = useAuthkitConfig();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes, type ReactNode } from
|
|
2
|
-
export interface PasskeyButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface PasskeyButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
|
|
3
3
|
optionsUrl: string;
|
|
4
4
|
verifyUrl: string;
|
|
5
5
|
csrfToken?: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createElement
|
|
2
|
-
import { usePasskeyLogin } from
|
|
3
|
-
import { buttonClass } from
|
|
4
|
-
const DEFAULT_ERROR =
|
|
5
|
-
export function PasskeyButton({ optionsUrl, verifyUrl, csrfToken, children =
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { usePasskeyLogin } from '../hooks/use_passkey_login.js';
|
|
3
|
+
import { buttonClass } from '../utils.js';
|
|
4
|
+
const DEFAULT_ERROR = 'Não foi possível autenticar com a passkey. Tente novamente.';
|
|
5
|
+
export function PasskeyButton({ optionsUrl, verifyUrl, csrfToken, children = 'Entrar com passkey', errorContent, className, ...rest }) {
|
|
6
6
|
const { authenticate, busy, failed } = usePasskeyLogin({
|
|
7
7
|
optionsUrl,
|
|
8
8
|
verifyUrl,
|
|
9
9
|
csrfToken,
|
|
10
10
|
});
|
|
11
|
-
const button = createElement(
|
|
12
|
-
type:
|
|
13
|
-
className: buttonClass(
|
|
11
|
+
const button = createElement('button', {
|
|
12
|
+
type: 'button',
|
|
13
|
+
className: buttonClass('authkit-button--ghost', className),
|
|
14
14
|
onClick: () => {
|
|
15
15
|
void authenticate();
|
|
16
16
|
},
|
|
@@ -19,5 +19,5 @@ export function PasskeyButton({ optionsUrl, verifyUrl, csrfToken, children = "En
|
|
|
19
19
|
}, children);
|
|
20
20
|
if (!failed || errorContent === null)
|
|
21
21
|
return button;
|
|
22
|
-
return createElement(
|
|
22
|
+
return createElement('div', { className: 'authkit-passkey' }, button, createElement('p', { className: 'authkit-passkey__error' }, errorContent ?? DEFAULT_ERROR));
|
|
23
23
|
}
|
|
@@ -12,10 +12,7 @@ export function PasswordStrengthMeter({ password, scorer, showFeedback = true, l
|
|
|
12
12
|
const cls = ['authkit-strength', className].filter(Boolean).join(' ');
|
|
13
13
|
const segments = [0, 1, 2, 3].map((i) => createElement('span', {
|
|
14
14
|
key: i,
|
|
15
|
-
className: [
|
|
16
|
-
'authkit-strength__segment',
|
|
17
|
-
i < score ? 'authkit-strength__segment--filled' : '',
|
|
18
|
-
]
|
|
15
|
+
className: ['authkit-strength__segment', i < score ? 'authkit-strength__segment--filled' : '']
|
|
19
16
|
.filter(Boolean)
|
|
20
17
|
.join(' '),
|
|
21
18
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement, useState } from 'react';
|
|
2
|
-
import { useAuth } from '../use_auth.js';
|
|
3
2
|
import { useAuthkitConfig } from '../config.js';
|
|
4
3
|
import { useSignOut } from '../hooks/use_sign_out.js';
|
|
4
|
+
import { useAuth } from '../use_auth.js';
|
|
5
5
|
import { Avatar } from './avatar.js';
|
|
6
6
|
export function UserButton({ profileLabel = 'Perfil', signOutLabel = 'Sair', className, }) {
|
|
7
7
|
const { user, isAuthenticated } = useAuth();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement, useState } from 'react';
|
|
3
3
|
import { useAuthkitConfig } from '../config.js';
|
|
4
|
-
import { useAuth } from '../use_auth.js';
|
|
5
4
|
import { useProfile } from '../hooks/use_profile.js';
|
|
5
|
+
import { useAuth } from '../use_auth.js';
|
|
6
6
|
import { Avatar } from './avatar.js';
|
|
7
7
|
function UserProfileInner({ className }) {
|
|
8
8
|
const { user, isAuthenticated } = useAuth();
|
package/build/src/config.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface AuthkitEndpoints {
|
|
|
7
7
|
orgInvitations: string;
|
|
8
8
|
can: string;
|
|
9
9
|
}
|
|
10
|
-
export type AuthkitIdpMode =
|
|
10
|
+
export type AuthkitIdpMode = 'authkit' | 'external';
|
|
11
11
|
export interface AuthkitConfig {
|
|
12
12
|
loginUrl?: string;
|
|
13
13
|
logoutUrl?: string;
|