Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin Vrel
projet-cdaw
Commits
8ab5e523
Commit
8ab5e523
authored
Dec 02, 2020
by
Zohten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added email check
parent
8c94ae59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
Register.vue
frontend/src/views/Register.vue
+10
-4
No files found.
frontend/src/views/Register.vue
View file @
8ab5e523
...
...
@@ -8,6 +8,7 @@
<pwd-input
id=
"password1"
label=
"Mot de passe"
/>
<pwd-input
id=
"password2"
label=
"Confirmer"
/>
<error-message
id=
"error-password"
errormessage=
"Les mots de passe ne correspondent pas."
v-show=
"this.showPwdError"
/>
<error-message
id=
"error-mail"
errormessage=
"Le mail rentré n'est pas valide"
v-show=
"this.showMailError"
/>
<error-message
id=
"error-back"
errormessage=
"Cet email ou ce pseudo est déjà pris."
v-show=
"this.showBackError"
/>
...
...
@@ -37,13 +38,10 @@ export default {
return
{
showPwdError
:
false
,
showBackError
:
false
,
showMailError
:
false
,
}
},
methods
:
{
updateShowPwdError
:
function
(){
this
.
showPwdError
=
(
document
.
getElementById
(
'password1'
).
value
!==
document
.
getElementById
(
'password2'
).
value
);
},
updateShowBackError
:
function
(){
this
.
showBackError
=
false
;
//TODO
},
...
...
@@ -52,6 +50,10 @@ export default {
if
(
this
.
showPwdError
)
{
return
;
}
this
.
showMailError
=
!
validateEmail
(
document
.
getElementById
(
'mail'
).
value
);
if
(
this
.
showMailError
)
{
return
;
}
this
.
showBackError
=
false
;
//TODO
if
(
this
.
showBackError
)
{
return
;
...
...
@@ -84,6 +86,10 @@ export default {
}
}
}
function
validateEmail
(
email
)
{
const
re
=
/^
[^\s
@
]
+@
[^\s
@
]
+
\.[^\s
@
]
+$/
;
return
re
.
test
(
String
(
email
).
toLowerCase
());
}
</
script
>
<
style
>
...
...
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