@live-change/password-authentication-service 0.8.119 → 0.8.121
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/package.json +3 -3
- package/reset.js +2 -2
- package/signIn.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/password-authentication-service",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.121",
|
|
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.8.
|
|
25
|
+
"@live-change/framework": "^0.8.121",
|
|
26
26
|
"nodemailer": "^6.7.2"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "2fd79c450701fcfe3f69fa92276efd351eb57580"
|
|
29
29
|
}
|
package/reset.js
CHANGED
|
@@ -3,7 +3,7 @@ const app = App.app()
|
|
|
3
3
|
import { randomString } from '@live-change/uid'
|
|
4
4
|
import definition from './definition.js'
|
|
5
5
|
const config = definition.config
|
|
6
|
-
import {
|
|
6
|
+
import { secretProperties } from './model.js'
|
|
7
7
|
|
|
8
8
|
const User = definition.foreignModel('user', 'User')
|
|
9
9
|
|
|
@@ -141,7 +141,7 @@ definition.action({
|
|
|
141
141
|
const resetPasswordAuthenticationData = await ResetPasswordAuthentication.indexObjectGet('byKey', key)
|
|
142
142
|
console.log("RESET AUTH", resetPasswordAuthenticationData)
|
|
143
143
|
if(!resetPasswordAuthenticationData) throw 'authenticationNotFound'
|
|
144
|
-
if(resetPasswordAuthenticationData.state
|
|
144
|
+
if(resetPasswordAuthenticationData.state === 'used') throw 'authenticationUsed'
|
|
145
145
|
if(resetPasswordAuthenticationData.expire < (new Date().toISOString())) throw 'authenticationExpired'
|
|
146
146
|
const { user } = resetPasswordAuthenticationData
|
|
147
147
|
emit([{
|