Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
students
messenger
Commits
f6928d0a
Commit
f6928d0a
authored
Jan 04, 2021
by
우지원
Browse files
회원가입 server연결중
parent
2a466264
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/src/Pages/SignUpPage.js
View file @
f6928d0a
...
...
@@ -55,7 +55,7 @@ function SingUp() {
// setUser(INIT_USER)
}
catch
(
error
)
{
console
.
log
(
error
)
setError
(
'
에러발생
'
)
setError
(
'
오류가 발생했습니다!
'
)
}
}
...
...
@@ -128,7 +128,6 @@ function SingUp() {
<
/Form.Control.Feedback
>
<
/Form.Group
>
{
/* <Link to="./login"> */
}
<
Button
disabled
=
{
disabled
}
...
...
package.json
View file @
f6928d0a
...
...
@@ -6,7 +6,7 @@
"type"
:
"module"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"dev"
:
"nodemon server/server.js"
,
"dev"
:
"nodemon server/server.js"
},
"repository"
:
{
"type"
:
"git"
,
...
...
server/controllers/user.controller.js
View file @
f6928d0a
import
User
from
"
../models/User.js
"
import
isLength
from
'
validator/lib/isLength.js
'
import
isEmail
from
'
validator/lib/isEmail.js
'
//
import isEmail from 'validator/lib/isEmail.js'
//꼭 js붙여주기!!
//sign validation해야됨
...
...
@@ -11,10 +11,9 @@ const signup = async (req, res) => {
console
.
log
(
username
,
nickname
,
email
,
password
)
try
{
if
(
!
isLength
(
username
,
{
min
:
3
,
max
:
10
}))
{
//이범위를 벗어나면 error발생
return
res
.
status
(
422
).
send
(
'
Name must be 3-10 characters
'
)
return
res
.
status
(
422
).
json
({
message
:
'
Name must be 3-10 characters
'
}
)
//422 : 형식이 잘못되었다는 error발생
}
else
if
(
!
isLength
(
nickname
,
{
min
:
3
,
max
:
10
}))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment