parent
5bd3a463f0
commit
4167819e7a
@ -1,15 +1,23 @@
|
|||||||
<script context="module">
|
<script context="module">
|
||||||
import { passwordStrength } from "check-password-strength";
|
import { passwordStrength } from "check-password-strength";
|
||||||
export function password_strong_enough(password_change) {
|
export function password_strong_enough(password_change) {
|
||||||
let strength = passwordStrength(password_change);
|
let strength = passwordStrength(password_change);
|
||||||
return (strength?.contains.includes("lowercase") &&
|
return (
|
||||||
strength?.contains.includes("uppercase") &&
|
strength?.contains.includes("lowercase") &&
|
||||||
strength?.contains.includes("number") &&
|
strength?.contains.includes("uppercase") &&
|
||||||
strength?.length > 9);
|
strength?.contains.includes("number") &&
|
||||||
}
|
strength?.length > 9
|
||||||
export function password_strong_enough_and_equal(password_change, password_confirm){
|
);
|
||||||
return password_strong_enough(password_change) && password_change === password_confirm;
|
}
|
||||||
}
|
export function password_strong_enough_and_equal(
|
||||||
|
password_change,
|
||||||
|
password_confirm
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
password_strong_enough(password_change) &&
|
||||||
|
password_change === password_confirm
|
||||||
|
);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -132,9 +132,7 @@
|
|||||||
<GenerateSponsoringContracts
|
<GenerateSponsoringContracts
|
||||||
bind:sponsoring_contracts_show
|
bind:sponsoring_contracts_show
|
||||||
bind:generate_orgs />
|
bind:generate_orgs />
|
||||||
<GenerateRunnerCards
|
<GenerateRunnerCards bind:cards_show bind:generate_orgs />
|
||||||
bind:cards_show
|
|
||||||
bind:generate_orgs />
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||||
import { RunnerOrganizationService, RunnerTeamService } from "@odit/lfk-client-js";
|
import {
|
||||||
|
RunnerOrganizationService,
|
||||||
|
RunnerTeamService,
|
||||||
|
} from "@odit/lfk-client-js";
|
||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
export let sponsoring_contracts_show = false;
|
export let sponsoring_contracts_show = false;
|
||||||
export let generate_runners = [];
|
export let generate_runners = [];
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
import { MeService } from "@odit/lfk-client-js";
|
import { MeService } from "@odit/lfk-client-js";
|
||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
import ConfirmProfileDeletion from "./ConfirmProfileDeletion.svelte";
|
import ConfirmProfileDeletion from "./ConfirmProfileDeletion.svelte";
|
||||||
import PasswordStrength, {password_strong_enough_and_equal} from "../auth/PasswordStrength.svelte";
|
import PasswordStrength, {
|
||||||
|
password_strong_enough_and_equal,
|
||||||
|
} from "../auth/PasswordStrength.svelte";
|
||||||
$: data_loaded = false;
|
$: data_loaded = false;
|
||||||
$: delete_triggered = false;
|
$: delete_triggered = false;
|
||||||
$: original_data = {};
|
$: original_data = {};
|
||||||
@ -16,7 +18,10 @@
|
|||||||
JSON.stringify(editable) === JSON.stringify(original_data)
|
JSON.stringify(editable) === JSON.stringify(original_data)
|
||||||
);
|
);
|
||||||
$: save_enabled = changes_performed && isEmail(editable.email);
|
$: save_enabled = changes_performed && isEmail(editable.email);
|
||||||
$: update_password_enabled = password_strong_enough_and_equal(password_change, password_confirm);
|
$: update_password_enabled = password_strong_enough_and_equal(
|
||||||
|
password_change,
|
||||||
|
password_confirm
|
||||||
|
);
|
||||||
const user_promise = MeService.meControllerGet().then((data) => {
|
const user_promise = MeService.meControllerGet().then((data) => {
|
||||||
data_loaded = true;
|
data_loaded = true;
|
||||||
data.groups = data.groups.map((g) => g.id);
|
data.groups = data.groups.map((g) => g.id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user