|
|
@@ -97,15 +97,19 @@ module.exports = class UserService extends Schmervice.Service {
|
|
97
|
97
|
}
|
|
98
|
98
|
// const todayTest = new Date.now()
|
|
99
|
99
|
console.log("password passed to .signup()", password)
|
|
100
|
|
- const steak = process.env.PEPPER+password
|
|
101
|
100
|
console.log("steak", steak)
|
|
102
|
101
|
console.log("user_email", userInfo.user_email)
|
|
103
|
102
|
|
|
104
|
103
|
const { email } = await Auth.query(txn).insert({
|
|
105
|
104
|
user_email: userInfo.user_email,
|
|
106
|
105
|
created_at: new Date.now(),
|
|
|
106
|
+ token: this.changePassword(
|
|
|
107
|
+ userInfo.user_email,
|
|
|
108
|
+ password,
|
|
|
109
|
+ txn,
|
|
|
110
|
+ ),
|
|
107
|
111
|
})
|
|
108
|
|
- await this.changePassword(email, steak, txn)
|
|
|
112
|
+
|
|
109
|
113
|
return userInfo.user_email
|
|
110
|
114
|
console.log("signup return finished")
|
|
111
|
115
|
// Library: Secure-Password
|
|
|
@@ -222,7 +226,9 @@ module.exports = class UserService extends Schmervice.Service {
|
|
222
|
226
|
.where({ email })
|
|
223
|
227
|
.patch({
|
|
224
|
228
|
// user_email: email,
|
|
225
|
|
- token: await this.pwd.hash(Buffer.from(password)),
|
|
|
229
|
+ token: await this.pwd.hash(
|
|
|
230
|
+ Buffer.from(process.env.PEPPER + password),
|
|
|
231
|
+ ),
|
|
226
|
232
|
})
|
|
227
|
233
|
console.log("changed pw return", email)
|
|
228
|
234
|
console.log("token created in changePassword", this.pwd.hash(Buffer.from(password)))
|