mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
og
This commit is contained in:
parent
94f416bbc4
commit
cc881c8995
|
@ -1,33 +0,0 @@
|
|||
import { fetchAccountData } from "../stores.mjs"
|
||||
|
||||
export function pwdChng(optPicker) {
|
||||
optPicker.picker("Change password",[
|
||||
{
|
||||
name: "New password",
|
||||
icon: "/static/assets/icons/change_password.svg",
|
||||
id: "password",
|
||||
inputSettings: {
|
||||
password: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "OK",
|
||||
icon: "/static/assets/icons/update.svg",
|
||||
description: "This will log you out of all sessions",
|
||||
id: true
|
||||
}
|
||||
]).then((exp) => {
|
||||
if (exp && exp.selected) {
|
||||
fetch(`/auth/change_password`,{method:"POST", body:JSON.stringify({
|
||||
password:exp.password
|
||||
})}).then((response) => {
|
||||
|
||||
if (response.status != 200) {
|
||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
||||
}
|
||||
|
||||
fetchAccountData()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
import { account, fetchAccountData, serverStats } from "../stores.mjs";
|
||||
import { fade } from "svelte/transition";
|
||||
import OptionPicker from "../prompts/OptionPicker.svelte";
|
||||
import { pwdChng } from "../prompts/passwordChange";
|
||||
import * as accOpts from "../prompts/account";
|
||||
|
||||
let targetAction
|
||||
let inProgress
|
||||
|
@ -124,7 +124,7 @@
|
|||
<p>Change username</p>
|
||||
</button>
|
||||
|
||||
<button on:click={() => pwdChng(optPicker)}>
|
||||
<button on:click={() => accOpts.pwdChng(optPicker)}>
|
||||
<img src="/static/assets/icons/change_password.svg" alt="change password">
|
||||
<p>Change password<span><br />You will be logged out of all sessions</span></p>
|
||||
</button>
|
||||
|
|
Loading…
Reference in a new issue