|
|
@ -30,7 +30,7 @@ export const _changeMyPassword = async (app, currentPw, newpassword) => { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (isSomething(existingAuth.passwordHash)) { |
|
|
if (isSomething(existingAuth.passwordHash)) { |
|
|
const verified = await app.crypto.verify( |
|
|
const verified = app.crypto.verify( |
|
|
existingAuth.passwordHash, |
|
|
existingAuth.passwordHash, |
|
|
currentPw, |
|
|
currentPw, |
|
|
); |
|
|
); |
|
|
@ -73,7 +73,7 @@ export const _setPasswordFromTemporaryCode = async (app, tempCode, newpassword) |
|
|
|
|
|
|
|
|
if (isSomething(existingAuth.temporaryAccessHash) |
|
|
if (isSomething(existingAuth.temporaryAccessHash) |
|
|
&& existingAuth.temporaryAccessExpiryEpoch > currentTime) { |
|
|
&& existingAuth.temporaryAccessExpiryEpoch > currentTime) { |
|
|
const verified = await app.crypto.verify( |
|
|
const verified = app.crypto.verify( |
|
|
existingAuth.temporaryAccessHash, |
|
|
existingAuth.temporaryAccessHash, |
|
|
temp.code, |
|
|
temp.code, |
|
|
); |
|
|
); |
|
|
@ -93,7 +93,7 @@ export const _setPasswordFromTemporaryCode = async (app, tempCode, newpassword) |
|
|
const doSet = async (app, auth, username, newpassword) => { |
|
|
const doSet = async (app, auth, username, newpassword) => { |
|
|
auth.temporaryAccessHash = ''; |
|
|
auth.temporaryAccessHash = ''; |
|
|
auth.temporaryAccessExpiryEpoch = 0; |
|
|
auth.temporaryAccessExpiryEpoch = 0; |
|
|
auth.passwordHash = await app.crypto.hash( |
|
|
auth.passwordHash = app.crypto.hash( |
|
|
newpassword, |
|
|
newpassword, |
|
|
); |
|
|
); |
|
|
await app.datastore.updateJson( |
|
|
await app.datastore.updateJson( |
|
|
|