Skip to content

Commit

Permalink
refactor(profile): remove old pass when changing password
Browse files Browse the repository at this point in the history
  • Loading branch information
mavyfaby committed Sep 21, 2023
1 parent 8aee172 commit 77c9754
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/components/dialogs/DialogChangePassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@
>
<div slot="headline">Change password</div>
<div class="grid gap-6" slot="content">
<md-filled-text-field
class="w-full"
label="Old Password"
v-model.trim="password"
type="password"
:disabled="isLoading"
@keydown.enter="submit"
required
>
<md-icon slot="leadingicon" v-html="icon('lock', true)" />
</md-filled-text-field>
<md-filled-text-field
class="w-full"
label="New Password"
Expand Down Expand Up @@ -68,7 +57,6 @@ const props = defineProps({
},
});
const password = ref("");
const newPassword = ref("");
const confirmPassword = ref("");
Expand All @@ -80,7 +68,7 @@ const isDialogOpen = computed(() => props.modelValue);
*/
function submit() {
// If all fields are empty
if (!password.value || !newPassword.value || !confirmPassword.value) {
if (!newPassword.value || !confirmPassword.value) {
toast.info("Empty fields.");
return;
}
Expand All @@ -98,7 +86,6 @@ function submit() {
// Send the request
makeRequest("PUT", Endpoints.StudentsKey, {
key: StudentEnum.password,
oldpass: password.value,
newpass: newPassword.value,
cnfpass: confirmPassword.value
}, response => {
Expand All @@ -122,7 +109,6 @@ function submit() {
*/
function close() {
// Reset the fields
password.value = "";
newPassword.value = "";
confirmPassword.value = "";
Expand Down

1 comment on commit 77c9754

@vercel
Copy link

@vercel vercel bot commented on 77c9754 Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

csps – ./

csps-git-main-csps.vercel.app
ucmncsps.org
csps-csps.vercel.app

Please sign in to comment.