@djangocfg/api 2.1.546 → 2.1.547

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.
Files changed (40) hide show
  1. package/dist/auth.cjs +331 -73
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.d.cts +90 -1
  4. package/dist/auth.d.ts +90 -1
  5. package/dist/auth.mjs +331 -73
  6. package/dist/auth.mjs.map +1 -1
  7. package/dist/clients.cjs +18 -0
  8. package/dist/clients.cjs.map +1 -1
  9. package/dist/clients.d.cts +96 -0
  10. package/dist/clients.d.ts +96 -0
  11. package/dist/clients.mjs +18 -0
  12. package/dist/clients.mjs.map +1 -1
  13. package/dist/hooks.cjs.map +1 -1
  14. package/dist/hooks.mjs.map +1 -1
  15. package/dist/index.cjs +18 -0
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +171 -3
  18. package/dist/index.d.ts +171 -3
  19. package/dist/index.mjs +18 -0
  20. package/dist/index.mjs.map +1 -1
  21. package/package.json +2 -2
  22. package/src/_api/generated/_cfg_accounts/hooks/index.ts +1 -0
  23. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenCreate.ts +64 -0
  24. package/src/_api/generated/_cfg_accounts/openapi.json +157 -0
  25. package/src/_api/generated/_cfg_accounts/schemas/PasswordLoginError.ts +13 -0
  26. package/src/_api/generated/_cfg_accounts/schemas/PasswordLoginRequest.ts +13 -0
  27. package/src/_api/generated/_cfg_accounts/schemas/PasswordLoginResponse.ts +18 -0
  28. package/src/_api/generated/_cfg_accounts/schemas/index.ts +3 -0
  29. package/src/_api/generated/openapi.json +157 -0
  30. package/src/_api/generated/sdk.gen.ts +20 -1
  31. package/src/_api/generated/types.gen.ts +149 -0
  32. package/src/auth/__tests__/passwordLogin.test.tsx +239 -0
  33. package/src/auth/context/AccountsContext.tsx +32 -7
  34. package/src/auth/context/AuthContext.tsx +104 -1
  35. package/src/auth/context/types.ts +10 -1
  36. package/src/auth/hooks/useAuthForm.ts +84 -0
  37. package/src/auth/hooks/useAuthFormState.ts +3 -0
  38. package/src/auth/types/form.ts +41 -1
  39. package/src/auth/types/index.ts +2 -0
  40. package/src/auth/utils/analytics.ts +1 -0
package/dist/index.cjs CHANGED
@@ -2062,6 +2062,24 @@ var CfgAccountsAuth = class {
2062
2062
  static {
2063
2063
  __name(this, "CfgAccountsAuth");
2064
2064
  }
2065
+ /**
2066
+ * Obtain a JWT pair with email + password.
2067
+ *
2068
+ * Returns the same envelope as OTP verify: either ``requires_2fa=True`` with
2069
+ * a session id, or the token pair plus the user object. Failures are uniform
2070
+ * (401 ``invalid_credentials``) whether the email is unknown, the password is
2071
+ * wrong, or the account is inactive/soft-deleted — no enumeration.
2072
+ */
2073
+ static cfgAccountsTokenCreate(options) {
2074
+ return (options.client ?? client).post({
2075
+ url: "/cfg/accounts/token/",
2076
+ ...options,
2077
+ headers: {
2078
+ "Content-Type": "application/json",
2079
+ ...options.headers
2080
+ }
2081
+ });
2082
+ }
2065
2083
  /**
2066
2084
  * Revoke a refresh token (logout).
2067
2085
  *