fix erroneous disable state in resetform
This commit is contained in:
parent
3593073c00
commit
06c9af9670
|
@ -12,8 +12,11 @@
|
||||||
async function reset() {
|
async function reset() {
|
||||||
try {
|
try {
|
||||||
if (forceResetPassword) {
|
if (forceResetPassword) {
|
||||||
console.log("Updating self!")
|
await auth.updateSelf({
|
||||||
await auth.updateSelf({ ...$auth.user, password })
|
...$auth.user,
|
||||||
|
password,
|
||||||
|
forceResetPassword: false,
|
||||||
|
})
|
||||||
$goto("../portal/")
|
$goto("../portal/")
|
||||||
} else {
|
} else {
|
||||||
await auth.resetPassword(password, resetCode)
|
await auth.resetPassword(password, resetCode)
|
||||||
|
@ -43,7 +46,12 @@
|
||||||
</Body>
|
</Body>
|
||||||
<PasswordRepeatInput bind:password bind:error />
|
<PasswordRepeatInput bind:password bind:error />
|
||||||
</Layout>
|
</Layout>
|
||||||
<Button cta on:click={reset} disabled={error}>Reset your password</Button>
|
<Button
|
||||||
|
cta
|
||||||
|
on:click={reset}
|
||||||
|
disabled={error || (forceResetPassword ? false : !resetCode)}
|
||||||
|
>Reset your password</Button
|
||||||
|
>
|
||||||
</Layout>
|
</Layout>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -53,7 +53,7 @@ export function createAuthStore() {
|
||||||
resetPassword: async (password, code) => {
|
resetPassword: async (password, code) => {
|
||||||
const response = await api.post(`/api/admin/auth/reset/update`, {
|
const response = await api.post(`/api/admin/auth/reset/update`, {
|
||||||
password,
|
password,
|
||||||
resetCode: code,
|
resetCode: code
|
||||||
})
|
})
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
throw "Unable to reset password"
|
throw "Unable to reset password"
|
||||||
|
|
Loading…
Reference in New Issue