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-05-27 21:12:01 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fcf6bf3f5e998476f7f15e137d304ce303befc77
fcf6bf3f
1 parent
651ff046
move variables position
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
back/src/api/User/createAccount/createAccount.js
back/src/api/User/createAccount/createAccount.js
View file @
fcf6bf3
...
...
@@ -9,13 +9,15 @@ export default {
password
,
password2
,
email
,
phoneNum
,
bio
,
avatarUrl
,
phoneNum
,
}
=
args
;
if
(
password
!==
password2
)
{
throw
new
Error
(
"two password aren't same each other"
);
}
const
encryptPw
=
await
bcrypt
.
hash
(
password
,
10
);
// TODO: Find user's country code and change new phone number value
const
newPhoneNumber
=
await
changePhoneNumber
(
phoneNum
,
"+82"
);
...
...
@@ -23,10 +25,10 @@ export default {
data
:
{
username
,
email
,
bio
,
avatarUrl
,
password
:
encryptPw
,
phoneNum
:
newPhoneNumber
,
bio
,
avatarUrl
,
},
});
const
token
=
generateToken
(
user
.
id
);
...
...
Please
register
or
login
to post a comment