Skip to content

Commit

Permalink
Merge pull request #88 from cheshire-cat-ai/allow-password-change
Browse files Browse the repository at this point in the history
allow editign password
  • Loading branch information
pieroit authored Aug 1, 2024
2 parents 08dab2b + b5679cc commit 2aafc42
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/views/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const canSave = computed(() => {
</div>
<div class="tooltip tooltip-left" data-tip="Delete">
<button
:disabled="item.username === 'admin' || cannot('DELETE', 'USERS')"
:disabled="cannot('DELETE', 'USERS')"
class="btn btn-square btn-error btn-xs"
@click="
() => {
Expand Down Expand Up @@ -188,14 +188,14 @@ const canSave = computed(() => {
placeholder="Type a username..."
class="input input-sm input-bordered w-full" />
</label>
<label v-if="!currentUser!.id" class="form-control w-full">
<label class="form-control w-full">
<div class="label">
<span class="label-text">Password</span>
</div>
<input
v-model="currentUser!.password"
type="text"
placeholder="Type a password..."
placeholder="New password..."
class="input input-sm input-bordered w-full" />
</label>
<div class="flex flex-col gap-2">
Expand Down Expand Up @@ -241,8 +241,9 @@ const canSave = computed(() => {
() => {
if (currentUser?.id) {
updateUser(currentUser!.id, {
permissions: currentUser!.permissions ?? {},
username: currentUser!.username,
permissions: currentUser!.permissions ?? {},
password: currentUser!.password ?? undefined,

Check failure on line 246 in src/views/SettingsView.vue

View workflow job for this annotation

GitHub Actions / build

Object literal may only specify known properties, and 'password' does not exist in type 'UserUpdate'.
})
} else {
createUser({
Expand Down

0 comments on commit 2aafc42

Please sign in to comment.