Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-04-26 19:14:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4c10175e78bfac61a79055917bd9e2fc3f0c098c
4c10175e
1 parent
2e4489a7
update resetPassword
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
back/src/api/User/resetPassword/resetPassword.js
back/src/api/User/resetPassword/resetPassword.js
View file @
4c10175
import
{
prisma
,
isAuthenticated
}
from
"../../../utils"
;
import
bcrypt
from
"bcryptjs"
;
export
default
{
Mutation
:
{
...
...
@@ -19,13 +20,14 @@ export default {
// For check new password is right, the two things must be same.
throw
new
Error
(
"the two password don't match each other, try again"
);
}
else
{
const
encyptPW
=
await
bcrypt
.
hash
(
passwordOne
,
10
);
await
prisma
.
user
.
update
({
where
:
{
email
,
},
data
:
{
emailSecret
:
""
,
password
:
passwordOne
,
password
:
encyptPW
,
},
});
}
...
...
Please
register
or
login
to post a comment