Skip to content

Commit c377e48

Browse files
authored
Add fix to remove Jwt Secret Key from store client (#142)
1 parent c233e2a commit c377e48

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/ajaxRouter.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ ajaxRouter.post('/login', async (req, res, next) => {
305305
return;
306306
}
307307
var customerPassword = result.password;
308-
var inputPassword = AuthHeader.decodeUserPassword(req.body.password)
309-
.password;
308+
var inputPassword = req.body.password;
310309

311310
bcrypt.compare(inputPassword, customerPassword, async function(err, out) {
312311
if (out == true) {
@@ -372,8 +371,7 @@ ajaxRouter.post('/register', async (req, res, next) => {
372371
).userId;
373372
const eMail = await AuthHeader.decodeUserLoginAuth(requestTokenArray[2])
374373
.userId;
375-
const passWord = await AuthHeader.decodeUserPassword(requestTokenArray[3])
376-
.password;
374+
const passWord = requestTokenArray[3]
377375

378376
if (
379377
requestTokenArray.length < 1 ||
@@ -481,8 +479,7 @@ ajaxRouter.put('/customer-account', async (req, res, next) => {
481479
const userId = JSON.stringify(token.userId).replace(/["']/g, '');
482480

483481
// generate password-hash
484-
const inputPassword = AuthHeader.decodeUserPassword(customerData.password)
485-
.password;
482+
const inputPassword = customerData.password;
486483
const salt = bcrypt.genSaltSync(saltRounds);
487484
const hashPassword = bcrypt.hashSync(inputPassword, salt);
488485

0 commit comments

Comments
 (0)