@dloizides/auth-web 1.14.0 → 1.16.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/CHANGELOG.md +38 -0
- package/dist/index.d.mts +268 -1
- package/dist/index.d.ts +268 -1
- package/dist/index.js +390 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +385 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StyleSheet, Platform, View, Text, TextInput, TouchableOpacity, ActivityIndicator, Pressable } from 'react-native';
|
|
1
|
+
import { StyleSheet, Platform, View, Text, TextInput, TouchableOpacity, ActivityIndicator, Pressable, ScrollView } from 'react-native';
|
|
2
2
|
import { createContext, useContext, useMemo, useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { useMutation } from '@tanstack/react-query';
|
|
@@ -307,6 +307,29 @@ var DEFAULT_RESET_PASSWORD_LABELS = {
|
|
|
307
307
|
errorNetwork: "Something went wrong. Please try again."
|
|
308
308
|
};
|
|
309
309
|
|
|
310
|
+
// src/components/labels/accountSettingsLabels.ts
|
|
311
|
+
var DEFAULT_ACCOUNT_SETTINGS_LABELS = {
|
|
312
|
+
heading: "Account settings",
|
|
313
|
+
changePasswordTitle: "Change password",
|
|
314
|
+
changePasswordDescription: "Update the password you use to sign in.",
|
|
315
|
+
currentPasswordLabel: "Current password",
|
|
316
|
+
currentPasswordPlaceholder: "Enter your current password",
|
|
317
|
+
newPasswordLabel: "New password",
|
|
318
|
+
newPasswordPlaceholder: "Enter a new password",
|
|
319
|
+
confirmPasswordLabel: "Confirm new password",
|
|
320
|
+
confirmPasswordPlaceholder: "Re-enter your new password",
|
|
321
|
+
submit: "Change password",
|
|
322
|
+
submitting: "Changing password...",
|
|
323
|
+
submitHint: "Submit the form to change your password",
|
|
324
|
+
success: "Your password has been changed.",
|
|
325
|
+
errorWeakNewPassword: "Your new password must be at least 8 characters and include an uppercase letter, a lowercase letter and a number.",
|
|
326
|
+
errorMismatch: "The new password and its confirmation do not match.",
|
|
327
|
+
errorCurrentRequired: "Enter your current password.",
|
|
328
|
+
errorInvalidCurrent: "Your current password is incorrect, or the new password does not meet the policy.",
|
|
329
|
+
errorUnauthorized: "Your session has expired. Sign in again to change your password.",
|
|
330
|
+
errorFailed: "Could not change your password. Try again later."
|
|
331
|
+
};
|
|
332
|
+
|
|
310
333
|
// src/components/testIds.ts
|
|
311
334
|
var AuthTestIds = {
|
|
312
335
|
loginForm: "auth-login-form",
|
|
@@ -380,6 +403,15 @@ var AuthTestIds = {
|
|
|
380
403
|
preferredMethodSettingsError: "auth-preferred-method-settings-error",
|
|
381
404
|
// Preferred-method login-screen hint
|
|
382
405
|
preferredMethodHint: "auth-preferred-method-hint",
|
|
406
|
+
// Account-settings screen shell + in-app change-password form
|
|
407
|
+
accountSettings: "auth-account-settings",
|
|
408
|
+
accountSettingsChangePassword: "auth-account-settings-change-password",
|
|
409
|
+
changePasswordCurrentInput: "auth-change-password-current",
|
|
410
|
+
changePasswordNewInput: "auth-change-password-new",
|
|
411
|
+
changePasswordConfirmInput: "auth-change-password-confirm",
|
|
412
|
+
changePasswordSubmit: "auth-change-password-submit",
|
|
413
|
+
changePasswordError: "auth-change-password-error",
|
|
414
|
+
changePasswordSuccess: "auth-change-password-success",
|
|
383
415
|
// Public-demo credentials panel
|
|
384
416
|
demoCredentialsHint: "auth-demo-credentials-hint",
|
|
385
417
|
demoCredentialsUsername: "auth-demo-credentials-username",
|
|
@@ -3201,6 +3233,307 @@ function PreferredMethodSettingsCard({
|
|
|
3201
3233
|
}
|
|
3202
3234
|
);
|
|
3203
3235
|
}
|
|
3236
|
+
|
|
3237
|
+
// src/password/ChangePasswordErrorKey.ts
|
|
3238
|
+
var ChangePasswordErrorKey = /* @__PURE__ */ ((ChangePasswordErrorKey2) => {
|
|
3239
|
+
ChangePasswordErrorKey2["WeakNewPassword"] = "weak_new_password";
|
|
3240
|
+
ChangePasswordErrorKey2["Mismatch"] = "mismatch";
|
|
3241
|
+
ChangePasswordErrorKey2["CurrentRequired"] = "current_required";
|
|
3242
|
+
ChangePasswordErrorKey2["InvalidCurrent"] = "invalid_current";
|
|
3243
|
+
ChangePasswordErrorKey2["Unauthorized"] = "unauthorized";
|
|
3244
|
+
ChangePasswordErrorKey2["Failed"] = "failed";
|
|
3245
|
+
return ChangePasswordErrorKey2;
|
|
3246
|
+
})(ChangePasswordErrorKey || {});
|
|
3247
|
+
function errorKeyForStatus(status) {
|
|
3248
|
+
if (status === "invalidCurrent") {
|
|
3249
|
+
return "invalid_current" /* InvalidCurrent */;
|
|
3250
|
+
}
|
|
3251
|
+
if (status === "unauthorized") {
|
|
3252
|
+
return "unauthorized" /* Unauthorized */;
|
|
3253
|
+
}
|
|
3254
|
+
return "failed" /* Failed */;
|
|
3255
|
+
}
|
|
3256
|
+
function useChangePassword({
|
|
3257
|
+
client,
|
|
3258
|
+
onChanged
|
|
3259
|
+
}) {
|
|
3260
|
+
const [currentPassword, setCurrentValue] = useState("");
|
|
3261
|
+
const [newPassword, setNewValue] = useState("");
|
|
3262
|
+
const [confirmPassword, setConfirmValue] = useState("");
|
|
3263
|
+
const [submitting, setSubmitting] = useState(false);
|
|
3264
|
+
const [succeeded, setSucceeded] = useState(false);
|
|
3265
|
+
const [errorKey, setErrorKey] = useState(null);
|
|
3266
|
+
const clearStatus = useCallback(() => {
|
|
3267
|
+
setErrorKey(null);
|
|
3268
|
+
setSucceeded(false);
|
|
3269
|
+
}, []);
|
|
3270
|
+
const setCurrentPassword = useCallback((value) => {
|
|
3271
|
+
setCurrentValue(value);
|
|
3272
|
+
clearStatus();
|
|
3273
|
+
}, [clearStatus]);
|
|
3274
|
+
const setNewPassword = useCallback((value) => {
|
|
3275
|
+
setNewValue(value);
|
|
3276
|
+
clearStatus();
|
|
3277
|
+
}, [clearStatus]);
|
|
3278
|
+
const setConfirmPassword = useCallback((value) => {
|
|
3279
|
+
setConfirmValue(value);
|
|
3280
|
+
clearStatus();
|
|
3281
|
+
}, [clearStatus]);
|
|
3282
|
+
const reset = useCallback(() => {
|
|
3283
|
+
setCurrentValue("");
|
|
3284
|
+
setNewValue("");
|
|
3285
|
+
setConfirmValue("");
|
|
3286
|
+
setSubmitting(false);
|
|
3287
|
+
setSucceeded(false);
|
|
3288
|
+
setErrorKey(null);
|
|
3289
|
+
}, []);
|
|
3290
|
+
const submit = useCallback(() => {
|
|
3291
|
+
if (currentPassword === "") {
|
|
3292
|
+
setErrorKey("current_required" /* CurrentRequired */);
|
|
3293
|
+
return;
|
|
3294
|
+
}
|
|
3295
|
+
if (newPassword !== confirmPassword) {
|
|
3296
|
+
setErrorKey("mismatch" /* Mismatch */);
|
|
3297
|
+
return;
|
|
3298
|
+
}
|
|
3299
|
+
if (!isPasswordValid(newPassword)) {
|
|
3300
|
+
setErrorKey("weak_new_password" /* WeakNewPassword */);
|
|
3301
|
+
return;
|
|
3302
|
+
}
|
|
3303
|
+
setErrorKey(null);
|
|
3304
|
+
setSucceeded(false);
|
|
3305
|
+
setSubmitting(true);
|
|
3306
|
+
client.changePassword({ currentPassword, newPassword }).then((result) => {
|
|
3307
|
+
if (result.status === "success") {
|
|
3308
|
+
setCurrentValue("");
|
|
3309
|
+
setNewValue("");
|
|
3310
|
+
setConfirmValue("");
|
|
3311
|
+
setSucceeded(true);
|
|
3312
|
+
onChanged?.();
|
|
3313
|
+
return;
|
|
3314
|
+
}
|
|
3315
|
+
setErrorKey(errorKeyForStatus(result.status));
|
|
3316
|
+
}).catch(() => {
|
|
3317
|
+
setErrorKey("failed" /* Failed */);
|
|
3318
|
+
}).finally(() => {
|
|
3319
|
+
setSubmitting(false);
|
|
3320
|
+
});
|
|
3321
|
+
}, [client, currentPassword, newPassword, confirmPassword, onChanged]);
|
|
3322
|
+
return {
|
|
3323
|
+
currentPassword,
|
|
3324
|
+
newPassword,
|
|
3325
|
+
confirmPassword,
|
|
3326
|
+
setCurrentPassword,
|
|
3327
|
+
setNewPassword,
|
|
3328
|
+
setConfirmPassword,
|
|
3329
|
+
submitting,
|
|
3330
|
+
succeeded,
|
|
3331
|
+
errorKey,
|
|
3332
|
+
submit,
|
|
3333
|
+
reset
|
|
3334
|
+
};
|
|
3335
|
+
}
|
|
3336
|
+
function errorMessage2(errorKey, labels) {
|
|
3337
|
+
switch (errorKey) {
|
|
3338
|
+
case "weak_new_password" /* WeakNewPassword */:
|
|
3339
|
+
return labels.errorWeakNewPassword;
|
|
3340
|
+
case "mismatch" /* Mismatch */:
|
|
3341
|
+
return labels.errorMismatch;
|
|
3342
|
+
case "current_required" /* CurrentRequired */:
|
|
3343
|
+
return labels.errorCurrentRequired;
|
|
3344
|
+
case "invalid_current" /* InvalidCurrent */:
|
|
3345
|
+
return labels.errorInvalidCurrent;
|
|
3346
|
+
case "unauthorized" /* Unauthorized */:
|
|
3347
|
+
return labels.errorUnauthorized;
|
|
3348
|
+
case "failed" /* Failed */:
|
|
3349
|
+
return labels.errorFailed;
|
|
3350
|
+
default:
|
|
3351
|
+
return null;
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
function ChangePasswordCard({
|
|
3355
|
+
client,
|
|
3356
|
+
theme: themeProp,
|
|
3357
|
+
labels: labelsProp,
|
|
3358
|
+
testIdPrefix,
|
|
3359
|
+
onChanged
|
|
3360
|
+
}) {
|
|
3361
|
+
const theme = useAuthTheme(themeProp);
|
|
3362
|
+
const styles3 = useAuthStyles(theme);
|
|
3363
|
+
const labels = useMemo(
|
|
3364
|
+
() => ({ ...DEFAULT_ACCOUNT_SETTINGS_LABELS, ...labelsProp }),
|
|
3365
|
+
[labelsProp]
|
|
3366
|
+
);
|
|
3367
|
+
const form = useChangePassword({ client, onChanged });
|
|
3368
|
+
const message = errorMessage2(form.errorKey, labels);
|
|
3369
|
+
return /* @__PURE__ */ jsxs(
|
|
3370
|
+
View,
|
|
3371
|
+
{
|
|
3372
|
+
style: styles3.card,
|
|
3373
|
+
testID: withTestIdPrefix(AuthTestIds.accountSettingsChangePassword, testIdPrefix),
|
|
3374
|
+
children: [
|
|
3375
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.title, children: labels.changePasswordTitle }),
|
|
3376
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.subtitle, children: labels.changePasswordDescription }),
|
|
3377
|
+
/* @__PURE__ */ jsxs(View, { style: styles3.fieldGroup, children: [
|
|
3378
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.label, children: labels.currentPasswordLabel }),
|
|
3379
|
+
/* @__PURE__ */ jsx(
|
|
3380
|
+
TextInput,
|
|
3381
|
+
{
|
|
3382
|
+
accessibilityLabel: labels.currentPasswordLabel,
|
|
3383
|
+
autoComplete: "current-password",
|
|
3384
|
+
placeholder: labels.currentPasswordPlaceholder,
|
|
3385
|
+
placeholderTextColor: theme.colors.textSecondary,
|
|
3386
|
+
secureTextEntry: true,
|
|
3387
|
+
style: styles3.input,
|
|
3388
|
+
testID: withTestIdPrefix(AuthTestIds.changePasswordCurrentInput, testIdPrefix),
|
|
3389
|
+
value: form.currentPassword,
|
|
3390
|
+
onChangeText: form.setCurrentPassword
|
|
3391
|
+
}
|
|
3392
|
+
)
|
|
3393
|
+
] }),
|
|
3394
|
+
/* @__PURE__ */ jsxs(View, { style: styles3.fieldGroup, children: [
|
|
3395
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.label, children: labels.newPasswordLabel }),
|
|
3396
|
+
/* @__PURE__ */ jsx(
|
|
3397
|
+
TextInput,
|
|
3398
|
+
{
|
|
3399
|
+
accessibilityLabel: labels.newPasswordLabel,
|
|
3400
|
+
autoComplete: "new-password",
|
|
3401
|
+
placeholder: labels.newPasswordPlaceholder,
|
|
3402
|
+
placeholderTextColor: theme.colors.textSecondary,
|
|
3403
|
+
secureTextEntry: true,
|
|
3404
|
+
style: styles3.input,
|
|
3405
|
+
testID: withTestIdPrefix(AuthTestIds.changePasswordNewInput, testIdPrefix),
|
|
3406
|
+
value: form.newPassword,
|
|
3407
|
+
onChangeText: form.setNewPassword
|
|
3408
|
+
}
|
|
3409
|
+
)
|
|
3410
|
+
] }),
|
|
3411
|
+
/* @__PURE__ */ jsxs(View, { style: styles3.fieldGroup, children: [
|
|
3412
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.label, children: labels.confirmPasswordLabel }),
|
|
3413
|
+
/* @__PURE__ */ jsx(
|
|
3414
|
+
TextInput,
|
|
3415
|
+
{
|
|
3416
|
+
accessibilityLabel: labels.confirmPasswordLabel,
|
|
3417
|
+
autoComplete: "new-password",
|
|
3418
|
+
placeholder: labels.confirmPasswordPlaceholder,
|
|
3419
|
+
placeholderTextColor: theme.colors.textSecondary,
|
|
3420
|
+
secureTextEntry: true,
|
|
3421
|
+
style: styles3.input,
|
|
3422
|
+
testID: withTestIdPrefix(AuthTestIds.changePasswordConfirmInput, testIdPrefix),
|
|
3423
|
+
value: form.confirmPassword,
|
|
3424
|
+
onChangeText: form.setConfirmPassword
|
|
3425
|
+
}
|
|
3426
|
+
)
|
|
3427
|
+
] }),
|
|
3428
|
+
message !== null ? /* @__PURE__ */ jsx(
|
|
3429
|
+
Text,
|
|
3430
|
+
{
|
|
3431
|
+
style: styles3.errorText,
|
|
3432
|
+
testID: withTestIdPrefix(AuthTestIds.changePasswordError, testIdPrefix),
|
|
3433
|
+
children: message
|
|
3434
|
+
}
|
|
3435
|
+
) : null,
|
|
3436
|
+
form.succeeded ? /* @__PURE__ */ jsx(
|
|
3437
|
+
Text,
|
|
3438
|
+
{
|
|
3439
|
+
style: styles3.successText,
|
|
3440
|
+
testID: withTestIdPrefix(AuthTestIds.changePasswordSuccess, testIdPrefix),
|
|
3441
|
+
children: labels.success
|
|
3442
|
+
}
|
|
3443
|
+
) : null,
|
|
3444
|
+
/* @__PURE__ */ jsx(
|
|
3445
|
+
TouchableOpacity,
|
|
3446
|
+
{
|
|
3447
|
+
accessibilityHint: labels.submitHint,
|
|
3448
|
+
accessibilityLabel: form.submitting ? labels.submitting : labels.submit,
|
|
3449
|
+
accessibilityRole: "button",
|
|
3450
|
+
disabled: form.submitting,
|
|
3451
|
+
style: form.submitting ? [styles3.primaryButton, styles3.primaryButtonDisabled] : styles3.primaryButton,
|
|
3452
|
+
testID: withTestIdPrefix(AuthTestIds.changePasswordSubmit, testIdPrefix),
|
|
3453
|
+
onPress: form.submit,
|
|
3454
|
+
children: form.submitting ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.onPrimary, size: "small" }) : /* @__PURE__ */ jsx(Text, { style: styles3.primaryButtonText, children: labels.submit })
|
|
3455
|
+
}
|
|
3456
|
+
)
|
|
3457
|
+
]
|
|
3458
|
+
}
|
|
3459
|
+
);
|
|
3460
|
+
}
|
|
3461
|
+
var GAP = 16;
|
|
3462
|
+
var layout = StyleSheet.create({
|
|
3463
|
+
content: {
|
|
3464
|
+
width: "100%",
|
|
3465
|
+
alignItems: "center",
|
|
3466
|
+
rowGap: GAP
|
|
3467
|
+
}
|
|
3468
|
+
});
|
|
3469
|
+
function AccountSettingsScreen({
|
|
3470
|
+
changePassword,
|
|
3471
|
+
devicePin,
|
|
3472
|
+
passkeys,
|
|
3473
|
+
preferredMethod,
|
|
3474
|
+
theme: themeProp,
|
|
3475
|
+
labels: labelsProp,
|
|
3476
|
+
testIdPrefix
|
|
3477
|
+
}) {
|
|
3478
|
+
const theme = useAuthTheme(themeProp);
|
|
3479
|
+
const styles3 = useAuthStyles(theme);
|
|
3480
|
+
const labels = useMemo(
|
|
3481
|
+
() => ({ ...DEFAULT_ACCOUNT_SETTINGS_LABELS, ...labelsProp }),
|
|
3482
|
+
[labelsProp]
|
|
3483
|
+
);
|
|
3484
|
+
return /* @__PURE__ */ jsx(
|
|
3485
|
+
ScrollView,
|
|
3486
|
+
{
|
|
3487
|
+
contentContainerStyle: styles3.screen,
|
|
3488
|
+
testID: withTestIdPrefix(AuthTestIds.accountSettings, testIdPrefix),
|
|
3489
|
+
children: /* @__PURE__ */ jsxs(View, { style: layout.content, children: [
|
|
3490
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.title, children: labels.heading }),
|
|
3491
|
+
/* @__PURE__ */ jsx(
|
|
3492
|
+
ChangePasswordCard,
|
|
3493
|
+
{
|
|
3494
|
+
client: changePassword.client,
|
|
3495
|
+
labels: labelsProp,
|
|
3496
|
+
testIdPrefix,
|
|
3497
|
+
theme,
|
|
3498
|
+
onChanged: changePassword.onChanged
|
|
3499
|
+
}
|
|
3500
|
+
),
|
|
3501
|
+
devicePin !== void 0 ? /* @__PURE__ */ jsx(
|
|
3502
|
+
DevicePinSettingsCard,
|
|
3503
|
+
{
|
|
3504
|
+
client: devicePin.client,
|
|
3505
|
+
enrollLabels: devicePin.enrollLabels,
|
|
3506
|
+
initialHasPin: devicePin.initialHasPin,
|
|
3507
|
+
labels: devicePin.labels,
|
|
3508
|
+
testIdPrefix,
|
|
3509
|
+
theme,
|
|
3510
|
+
onChanged: devicePin.onChanged
|
|
3511
|
+
}
|
|
3512
|
+
) : null,
|
|
3513
|
+
passkeys !== void 0 ? /* @__PURE__ */ jsx(
|
|
3514
|
+
PasskeySettingsCard,
|
|
3515
|
+
{
|
|
3516
|
+
labels: passkeys.labels,
|
|
3517
|
+
returnUrl: passkeys.returnUrl,
|
|
3518
|
+
testIdPrefix,
|
|
3519
|
+
theme
|
|
3520
|
+
}
|
|
3521
|
+
) : null,
|
|
3522
|
+
preferredMethod !== void 0 ? /* @__PURE__ */ jsx(
|
|
3523
|
+
PreferredMethodSettingsCard,
|
|
3524
|
+
{
|
|
3525
|
+
availableMethods: preferredMethod.availableMethods,
|
|
3526
|
+
client: preferredMethod.client,
|
|
3527
|
+
labels: preferredMethod.labels,
|
|
3528
|
+
testIdPrefix,
|
|
3529
|
+
theme,
|
|
3530
|
+
onChanged: preferredMethod.onChanged
|
|
3531
|
+
}
|
|
3532
|
+
) : null
|
|
3533
|
+
] })
|
|
3534
|
+
}
|
|
3535
|
+
);
|
|
3536
|
+
}
|
|
3204
3537
|
function hintFor(method, labels) {
|
|
3205
3538
|
if (method === "password") {
|
|
3206
3539
|
return labels.password;
|
|
@@ -3717,7 +4050,57 @@ async function performBffLogout(options) {
|
|
|
3717
4050
|
}
|
|
3718
4051
|
runGuarded(onRedirect, onError);
|
|
3719
4052
|
}
|
|
4053
|
+
var CHANGE_PASSWORD_ENDPOINT = "/bff/account/change-password";
|
|
4054
|
+
var CSRF_HEADER2 = "X-BFF-Csrf";
|
|
4055
|
+
var CSRF_HEADER_VALUE2 = "1";
|
|
4056
|
+
var JSON_CONTENT_TYPE2 = "application/json";
|
|
4057
|
+
var HTTP_NO_CONTENT = 204;
|
|
4058
|
+
var HTTP_OK = 200;
|
|
4059
|
+
var HTTP_BAD_REQUEST2 = 400;
|
|
4060
|
+
var HTTP_UNAUTHORIZED = 401;
|
|
4061
|
+
async function lazyFetchHttpClient2(request) {
|
|
4062
|
+
const fetchImpl = typeof fetch === "function" ? fetch.bind(globalThis) : void 0;
|
|
4063
|
+
if (fetchImpl === void 0) {
|
|
4064
|
+
throw new Error("createBffChangePasswordClient: fetch is not available in this environment");
|
|
4065
|
+
}
|
|
4066
|
+
return createFetchHttpClient(fetchImpl)(request);
|
|
4067
|
+
}
|
|
4068
|
+
function resultFromStatus(status) {
|
|
4069
|
+
if (status === HTTP_NO_CONTENT || status === HTTP_OK) {
|
|
4070
|
+
return { status: "success" };
|
|
4071
|
+
}
|
|
4072
|
+
if (status === HTTP_BAD_REQUEST2) {
|
|
4073
|
+
return { status: "invalidCurrent" };
|
|
4074
|
+
}
|
|
4075
|
+
if (status === HTTP_UNAUTHORIZED) {
|
|
4076
|
+
return { status: "unauthorized" };
|
|
4077
|
+
}
|
|
4078
|
+
return { status: "error" };
|
|
4079
|
+
}
|
|
4080
|
+
function createBffChangePasswordClient(options = {}) {
|
|
4081
|
+
const http = options.http ?? lazyFetchHttpClient2;
|
|
4082
|
+
const baseUrl = options.baseUrl ?? "";
|
|
4083
|
+
const url = `${baseUrl}${CHANGE_PASSWORD_ENDPOINT}`;
|
|
4084
|
+
return {
|
|
4085
|
+
changePassword: async (request) => {
|
|
4086
|
+
try {
|
|
4087
|
+
const response = await http({
|
|
4088
|
+
url,
|
|
4089
|
+
method: "POST",
|
|
4090
|
+
headers: { "Content-Type": JSON_CONTENT_TYPE2, [CSRF_HEADER2]: CSRF_HEADER_VALUE2 },
|
|
4091
|
+
body: JSON.stringify({
|
|
4092
|
+
currentPassword: request.currentPassword,
|
|
4093
|
+
newPassword: request.newPassword
|
|
4094
|
+
})
|
|
4095
|
+
});
|
|
4096
|
+
return resultFromStatus(response.status);
|
|
4097
|
+
} catch {
|
|
4098
|
+
return { status: "error" };
|
|
4099
|
+
}
|
|
4100
|
+
}
|
|
4101
|
+
};
|
|
4102
|
+
}
|
|
3720
4103
|
|
|
3721
|
-
export { AuthScreen, AuthTestIds, AuthThemeProvider, BffAuthStatus, DEFAULT_AUTH_CARD_MAX_WIDTH, DEFAULT_DEMO_CREDENTIALS_HINT_LABELS, DEFAULT_DEVICE_PIN_ENROLL_LABELS, DEFAULT_DEVICE_PIN_SETTINGS_LABELS, DEFAULT_DEVICE_PIN_UNLOCK_LABELS, DEFAULT_FORGOT_PASSWORD_FIELDS_LABELS, DEFAULT_FORGOT_PASSWORD_LABELS, DEFAULT_LOGIN_LABELS, DEFAULT_OTP_LABELS, DEFAULT_PASSKEY_LOGIN_LABELS, DEFAULT_PASSKEY_SETTINGS_LABELS, DEFAULT_PIN_LABELS, DEFAULT_PREFERRED_METHOD_HINT_LABELS, DEFAULT_PREFERRED_METHOD_SETTINGS_LABELS, DEFAULT_RESET_PASSWORD_LABELS, DEVICE_PIN_ALLOWED_DIGITS, DEVICE_PIN_DEFAULT_DIGITS, DemoCredentialsHint, DemoCredentialsHintVariant, DevicePinEnrollErrorKey, DevicePinEnrollForm, DevicePinErrorKey, DevicePinInput, DevicePinLengthPicker, DevicePinOffer, DevicePinSettingsCard, DevicePinUnlockScreen, ForgotPasswordFields, ForgotPasswordForm, LoginForm, OtpForm, OtpLoginStep, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasskeyCeremonyMode, PasskeyCeremonyStatus, PasskeyLoginButton, PasskeySettingsCard, PasswordPolicyError, PinForm, PreferredMethodHint, PreferredMethodSettingsCard, PrefillIntent, ResetPasswordError, ResetPasswordForm, cachePreferredMethod, clearCachedPreferredMethod, collectUserRoles, createBffAuthClient, createPreferencesClient, defaultAuthTheme, isAllowedPinDigits, isPasswordValid, isValidForgotPasswordEmail, performBffLogout, readCachedPreferredMethod, readPasskeyError, readPasskeyRegistered, resolveAccessibleRoutes, resolveDemoCredentials, resolvePostLoginRoute, startPasskeyLogin, startPasskeyRegistration, syncPreferredMethodFromServer, useAuthTheme, useBffAuth, useBffForgotPassword, useBffLoginConfig, useBffResetPassword, useDemoCredentials, useDevicePinDisable, useDevicePinEnroll, useDevicePinUnlock, useForgotPasswordSubmit, useOtpLogin, usePasskeyCeremony, usePinLogin, usePreferredMethodSetting, useResetPasswordForm, validatePasswordPolicy, withTestIdPrefix };
|
|
4104
|
+
export { AccountSettingsScreen, AuthScreen, AuthTestIds, AuthThemeProvider, BffAuthStatus, CHANGE_PASSWORD_ENDPOINT, ChangePasswordCard, ChangePasswordErrorKey, DEFAULT_ACCOUNT_SETTINGS_LABELS, DEFAULT_AUTH_CARD_MAX_WIDTH, DEFAULT_DEMO_CREDENTIALS_HINT_LABELS, DEFAULT_DEVICE_PIN_ENROLL_LABELS, DEFAULT_DEVICE_PIN_SETTINGS_LABELS, DEFAULT_DEVICE_PIN_UNLOCK_LABELS, DEFAULT_FORGOT_PASSWORD_FIELDS_LABELS, DEFAULT_FORGOT_PASSWORD_LABELS, DEFAULT_LOGIN_LABELS, DEFAULT_OTP_LABELS, DEFAULT_PASSKEY_LOGIN_LABELS, DEFAULT_PASSKEY_SETTINGS_LABELS, DEFAULT_PIN_LABELS, DEFAULT_PREFERRED_METHOD_HINT_LABELS, DEFAULT_PREFERRED_METHOD_SETTINGS_LABELS, DEFAULT_RESET_PASSWORD_LABELS, DEVICE_PIN_ALLOWED_DIGITS, DEVICE_PIN_DEFAULT_DIGITS, DemoCredentialsHint, DemoCredentialsHintVariant, DevicePinEnrollErrorKey, DevicePinEnrollForm, DevicePinErrorKey, DevicePinInput, DevicePinLengthPicker, DevicePinOffer, DevicePinSettingsCard, DevicePinUnlockScreen, ForgotPasswordFields, ForgotPasswordForm, LoginForm, OtpForm, OtpLoginStep, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasskeyCeremonyMode, PasskeyCeremonyStatus, PasskeyLoginButton, PasskeySettingsCard, PasswordPolicyError, PinForm, PreferredMethodHint, PreferredMethodSettingsCard, PrefillIntent, ResetPasswordError, ResetPasswordForm, cachePreferredMethod, clearCachedPreferredMethod, collectUserRoles, createBffAuthClient, createBffChangePasswordClient, createPreferencesClient, defaultAuthTheme, isAllowedPinDigits, isPasswordValid, isValidForgotPasswordEmail, performBffLogout, readCachedPreferredMethod, readPasskeyError, readPasskeyRegistered, resolveAccessibleRoutes, resolveDemoCredentials, resolvePostLoginRoute, startPasskeyLogin, startPasskeyRegistration, syncPreferredMethodFromServer, useAuthTheme, useBffAuth, useBffForgotPassword, useBffLoginConfig, useBffResetPassword, useChangePassword, useDemoCredentials, useDevicePinDisable, useDevicePinEnroll, useDevicePinUnlock, useForgotPasswordSubmit, useOtpLogin, usePasskeyCeremony, usePinLogin, usePreferredMethodSetting, useResetPasswordForm, validatePasswordPolicy, withTestIdPrefix };
|
|
3722
4105
|
//# sourceMappingURL=index.mjs.map
|
|
3723
4106
|
//# sourceMappingURL=index.mjs.map
|