react-redux-django-auth 1.3.4 → 1.3.6
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -4
- package/dist/index.mjs +6 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -76,7 +76,7 @@ declare const usePasswordConfirm: (initialFields: FormData$1, apiUrl: string) =>
|
|
|
76
76
|
interface FormData {
|
|
77
77
|
current_password?: string;
|
|
78
78
|
new_password?: string;
|
|
79
|
-
|
|
79
|
+
re_new_password?: string;
|
|
80
80
|
}
|
|
81
81
|
interface ChangePasswordHookReturn {
|
|
82
82
|
loading: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ declare const usePasswordConfirm: (initialFields: FormData$1, apiUrl: string) =>
|
|
|
76
76
|
interface FormData {
|
|
77
77
|
current_password?: string;
|
|
78
78
|
new_password?: string;
|
|
79
|
-
|
|
79
|
+
re_new_password?: string;
|
|
80
80
|
}
|
|
81
81
|
interface ChangePasswordHookReturn {
|
|
82
82
|
loading: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1570,13 +1570,13 @@ var useChangeAuthenticatedUserPassword = function(initialFields, apiUrl) {
|
|
|
1570
1570
|
}, []);
|
|
1571
1571
|
var handleSubmit = (0, import_react8.useCallback)(function(e) {
|
|
1572
1572
|
return _async_to_generator(function() {
|
|
1573
|
-
var current_password, new_password,
|
|
1573
|
+
var current_password, new_password, re_new_password, err;
|
|
1574
1574
|
return _ts_generator(this, function(_state) {
|
|
1575
1575
|
switch(_state.label){
|
|
1576
1576
|
case 0:
|
|
1577
1577
|
e.preventDefault();
|
|
1578
|
-
current_password = formData.current_password, new_password = formData.new_password,
|
|
1579
|
-
if (new_password !==
|
|
1578
|
+
current_password = formData.current_password, new_password = formData.new_password, re_new_password = formData.re_new_password;
|
|
1579
|
+
if (new_password !== re_new_password) {
|
|
1580
1580
|
setError("New passwords do not match.");
|
|
1581
1581
|
return [
|
|
1582
1582
|
2
|
|
@@ -1596,7 +1596,8 @@ var useChangeAuthenticatedUserPassword = function(initialFields, apiUrl) {
|
|
|
1596
1596
|
4,
|
|
1597
1597
|
dispatch(changeLoggedInUserPassword({
|
|
1598
1598
|
current_password: current_password,
|
|
1599
|
-
new_password: new_password
|
|
1599
|
+
new_password: new_password,
|
|
1600
|
+
re_new_password: re_new_password
|
|
1600
1601
|
}, apiUrl))
|
|
1601
1602
|
];
|
|
1602
1603
|
case 2:
|
package/dist/index.mjs
CHANGED
|
@@ -607,8 +607,8 @@ var useChangeAuthenticatedUserPassword = (initialFields, apiUrl) => {
|
|
|
607
607
|
const handleSubmit = useCallback8(
|
|
608
608
|
async (e) => {
|
|
609
609
|
e.preventDefault();
|
|
610
|
-
const { current_password, new_password,
|
|
611
|
-
if (new_password !==
|
|
610
|
+
const { current_password, new_password, re_new_password } = formData;
|
|
611
|
+
if (new_password !== re_new_password) {
|
|
612
612
|
setError("New passwords do not match.");
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
@@ -616,7 +616,10 @@ var useChangeAuthenticatedUserPassword = (initialFields, apiUrl) => {
|
|
|
616
616
|
setLoading(true);
|
|
617
617
|
try {
|
|
618
618
|
await dispatch(
|
|
619
|
-
changeLoggedInUserPassword(
|
|
619
|
+
changeLoggedInUserPassword(
|
|
620
|
+
{ current_password, new_password, re_new_password },
|
|
621
|
+
apiUrl
|
|
622
|
+
)
|
|
620
623
|
);
|
|
621
624
|
} catch (err) {
|
|
622
625
|
console.error("Error submitting form", err);
|