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 18:40:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7931803229125c907613e25f36e890b131293354
79318032
1 parent
b251b5ac
update resetPassword
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
back/src/api/User/resetPassword/resetPassword.js
back/src/api/User/resetPassword/resetPassword.js
View file @
7931803
...
...
@@ -4,7 +4,6 @@ import bcrypt from "bcryptjs";
export
default
{
Mutation
:
{
resetPassword
:
async
(
_
,
args
,
{
request
})
=>
{
console
.
log
(
request
);
isAuthenticated
(
request
);
const
{
emailSecret
,
email
,
passwordOne
,
passwordTwo
}
=
args
;
const
user
=
await
prisma
.
user
.
findOne
({
...
...
@@ -12,8 +11,7 @@ export default {
email
,
},
});
const
encryptSecret
=
await
bcrypt
.
hash
(
user
.
emailSecret
,
10
);
if
(
encryptSecret
!==
emailSecret
)
{
if
(
user
.
emailSecret
!==
emailSecret
)
{
throw
new
Error
(
"not vaild secret value!, input another value or resend email"
);
...
...
Please
register
or
login
to post a comment