@live-change/password-authentication-service 0.9.194 → 0.9.196
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/change.js +2 -2
- package/package.json +3 -3
- package/reset.js +3 -3
package/change.js
CHANGED
|
@@ -13,7 +13,7 @@ definition.action({
|
|
|
13
13
|
async execute({ passwordHash }, { client, service }, emit) {
|
|
14
14
|
const user = client.user
|
|
15
15
|
const passwordAuthenticationData = await PasswordAuthentication.get(user)
|
|
16
|
-
if(passwordAuthenticationData) throw
|
|
16
|
+
if(passwordAuthenticationData) throw app.logicError("exists")
|
|
17
17
|
emit({
|
|
18
18
|
type: 'passwordAuthenticationSet',
|
|
19
19
|
user, passwordHash
|
|
@@ -34,7 +34,7 @@ definition.action({
|
|
|
34
34
|
async execute({ currentPasswordHash, passwordHash }, { client, service }, emit) {
|
|
35
35
|
const user = client.user
|
|
36
36
|
const passwordAuthenticationData = await PasswordAuthentication.get(user)
|
|
37
|
-
if(!passwordAuthenticationData) throw
|
|
37
|
+
if(!passwordAuthenticationData) throw app.logicError("notFound")
|
|
38
38
|
if(currentPasswordHash !== passwordAuthenticationData.passwordHash) throw { properties: {
|
|
39
39
|
currentPasswordHash: 'wrongPassword'
|
|
40
40
|
} }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/password-authentication-service",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.196",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@live-change/framework": "^0.9.
|
|
25
|
+
"@live-change/framework": "^0.9.196",
|
|
26
26
|
"nodemailer": "^6.7.2"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "7f358a1cc16fb35069f6ce3f897412232f766843"
|
|
29
29
|
}
|
package/reset.js
CHANGED
|
@@ -140,9 +140,9 @@ definition.action({
|
|
|
140
140
|
async execute({ key, passwordHash }, { client, service }, emit) {
|
|
141
141
|
const resetPasswordAuthenticationData = await ResetPasswordAuthentication.indexObjectGet('byKey', key)
|
|
142
142
|
console.log("RESET AUTH", resetPasswordAuthenticationData)
|
|
143
|
-
if(!resetPasswordAuthenticationData) throw
|
|
144
|
-
if(resetPasswordAuthenticationData.state === 'used') throw
|
|
145
|
-
if(resetPasswordAuthenticationData.expire < (new Date().toISOString())) throw
|
|
143
|
+
if(!resetPasswordAuthenticationData) throw app.logicError("authenticationNotFound")
|
|
144
|
+
if(resetPasswordAuthenticationData.state === 'used') throw app.logicError("authenticationUsed")
|
|
145
|
+
if(resetPasswordAuthenticationData.expire < (new Date().toISOString())) throw app.logicError("authenticationExpired")
|
|
146
146
|
const { user } = resetPasswordAuthenticationData
|
|
147
147
|
emit([{
|
|
148
148
|
type: 'passwordAuthenticationSet',
|