-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: password reset frontend done, backend started
- Loading branch information
1 parent
7a982e2
commit d15e0a1
Showing
8 changed files
with
139 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
apps/wizarr-frontend/src/modules/settings/pages/Password.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<FormKit type="form" @submit="changePassword" :actions="false"> | ||
<div class="space-y-4"> | ||
<FormKit type="password" v-model="old_password" label="Old Password" name="old_password" placeholder="Old Password" required autocomplete="current-password" /> | ||
<!-- <FormKit type="password" v-model="new_password" label="New Password" name="new_password" placeholder="New Password" required autocomplete="new-password" validation="length:20|*required" /> --> | ||
<FormKit type="password" v-model="new_password" label="New Password" name="new_password" placeholder="New Password" required autocomplete="new-password" /> | ||
<FormKit type="password" v-model="confirm_password" label="Confirm New Password" name="confirm_password" placeholder="Confirm New Password" required autocomplete="new-password" /> | ||
|
||
<div class=""> | ||
<FormKit type="submit" :classes="{ outer: 'w-auto', input: 'text-xs w-auto justify-center !font-bold' }"> | ||
{{ __("Confirm") }} | ||
</FormKit> | ||
</div> | ||
</div> | ||
</FormKit> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from "vue"; | ||
import DefaultNavBar from "@/components/NavBars/DefaultNavBar.vue"; | ||
import DefaultLoading from "@/components/Loading/DefaultLoading.vue"; | ||
import Auth from "@/api/authentication"; | ||
export default defineComponent({ | ||
name: "LoginView", | ||
components: { | ||
DefaultNavBar, | ||
DefaultLoading, | ||
}, | ||
data() { | ||
return { | ||
auth: new Auth(), | ||
old_password: "", | ||
new_password: "", | ||
confirm_password: "", | ||
}; | ||
}, | ||
methods: { | ||
resetForm() { | ||
this.old_password = ""; | ||
this.new_password = ""; | ||
this.confirm_password = ""; | ||
}, | ||
async changePassword({ old_password, new_password, confirm_password }: { old_password: string; new_password: string; confirm_password: string }) { | ||
if (new_password !== confirm_password) { | ||
this.$toast.error("Passwords do not match"); | ||
return; | ||
} | ||
await this.auth.changePassword(old_password, new_password).then((res) => { | ||
if (res !== undefined) { | ||
this.$toast.success("Password changed successfully"); | ||
} | ||
}); | ||
this.resetForm(); | ||
}, | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.