@isoftdata/svelte-user-configuration 1.2.3 → 1.2.5
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.
|
@@ -16,7 +16,7 @@ let passwordRecoveryEmail = void 0;
|
|
|
16
16
|
let passwordIsValid = false;
|
|
17
17
|
export let validationRules = void 0;
|
|
18
18
|
export let changePasswordMode = false;
|
|
19
|
-
export let confirmPasswordSet
|
|
19
|
+
export let confirmPasswordSet;
|
|
20
20
|
export async function open(userAccount) {
|
|
21
21
|
currentPassword = "";
|
|
22
22
|
newPassword = "";
|
|
@@ -50,7 +50,7 @@ $: disablePasswordChange = changePasswordMode && !currentPassword || passwordMis
|
|
|
50
50
|
id="setPasswordForm"
|
|
51
51
|
on:submit={async e => {
|
|
52
52
|
e.preventDefault()
|
|
53
|
-
if (!disablePasswordChange
|
|
53
|
+
if (!disablePasswordChange) {
|
|
54
54
|
await confirmPasswordSet({ currentPassword, newPassword })
|
|
55
55
|
show = false
|
|
56
56
|
}
|
|
@@ -4,10 +4,10 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
validationRules?: PasswordValidationRules | undefined;
|
|
6
6
|
changePasswordMode?: boolean;
|
|
7
|
-
confirmPasswordSet
|
|
7
|
+
confirmPasswordSet: (ctx: {
|
|
8
8
|
currentPassword: string;
|
|
9
9
|
newPassword: string;
|
|
10
|
-
}) => void | Promise<void
|
|
10
|
+
}) => void | Promise<void>;
|
|
11
11
|
open?: (userAccount?: UserAccount) => Promise<void>;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
<script>import { getContext
|
|
1
|
+
<script>import { getContext } from "svelte";
|
|
2
2
|
import Icon from "@isoftdata/svelte-icon";
|
|
3
3
|
import Input from "@isoftdata/svelte-input";
|
|
4
4
|
import Button from "@isoftdata/svelte-button";
|
|
5
5
|
import TextArea from "@isoftdata/svelte-textarea";
|
|
6
6
|
import PasswordSetModal from "./PasswordSetModal.svelte";
|
|
7
|
-
import PasswordFields from "@isoftdata/svelte-password-fields";
|
|
8
7
|
import DeactivateUserModal from "./DeactivateUserModal.svelte";
|
|
9
8
|
import PasswordRecoveryModal from "./PasswordRecoveryModal.svelte";
|
|
10
9
|
import { translate as defaultTranslate } from "@isoftdata/utility-string";
|
|
@@ -326,6 +325,8 @@ $: isCreatingNewUser = userAccount.id === null;
|
|
|
326
325
|
heading: translate('configuration.user.passwordChangeFailure', 'Failed To Change Password'),
|
|
327
326
|
message: err instanceof Error ? err.message : translate('workOrder.unknownError', 'An unknown error occurred'),
|
|
328
327
|
})
|
|
328
|
+
console.error(err)
|
|
329
|
+
throw err
|
|
329
330
|
}
|
|
330
331
|
} else {
|
|
331
332
|
//Guess if they didn't give us a confirmPasswordSet function to call we'll just update the userAccount object and they can handle it later
|