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
0
Issues
0
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
Thibaut Felten
projet-cdaw
Commits
b8ee91b9
Commit
b8ee91b9
authored
Dec 01, 2020
by
thibaut-felten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sign up
parent
635a174a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
9 deletions
+54
-9
Inscription.vue
frontend/src/views/Inscription.vue
+54
-8
Login.vue
frontend/src/views/Login.vue
+0
-1
No files found.
frontend/src/views/Inscription.vue
View file @
b8ee91b9
...
...
@@ -3,30 +3,30 @@
<div
class=
"row _centered"
>
<div
class=
"column _600"
>
<h1>
Inscription
</h1>
<form
action=
"post"
class=
"form"
>
<form
action=
"post"
class=
"form"
v-on:submit
.
prevent=
"check"
>
<div
class=
"row lmargin"
>
<label
for=
"FirstName"
>
Prénom
</label>
<input
type=
"text"
name=
"FirstName"
required
>
<input
v-model=
"firstname"
type=
"text"
name=
"FirstName"
required
>
</div>
<div
class=
"row lmargin"
>
<label
for=
"LastName"
>
Nom
</label>
<input
type=
"text"
name=
"LastName"
required
>
<input
v-model=
"lastname"
type=
"text"
name=
"LastName"
required
>
</div>
<div
class=
"row lmargin"
>
<label
for=
"Login"
>
Login
</label>
<input
type=
"text"
name=
"Login"
required
>
<input
v-model=
"login"
type=
"text"
name=
"Login"
required
>
</div>
<div
class=
"row lmargin"
>
<label
for=
"Email"
>
Email
</label>
<input
type=
"email"
name=
"Email"
required
>
<input
v-model=
"email"
type=
"email"
name=
"Email"
required
>
</div>
<div
class=
"row lmargin"
>
<label
for=
"Password"
>
Mot de passe
</label>
<input
type=
"password"
name=
"Password"
required
>
<input
v-model=
"password"
type=
"password"
name=
"Password"
required
>
</div>
<div
class=
"row lmargin"
>
<label
for=
"ConfirmPassword"
>
Confirmer MdP
</label>
<input
type=
"password"
name=
"ConfirmPassword"
required
>
<input
v-model=
"confirmpassword"
type=
"password"
name=
"ConfirmPassword"
required
>
</div>
<div
class=
"row lmargin"
>
<button
type=
"submit"
class=
"btn"
>
Valider
</button>
...
...
@@ -90,7 +90,53 @@
<
script
>
export
default
{
name
:
'Inscription'
name
:
'Inscription'
,
methods
:
{
check
:
function
(){
let
firstname
=
this
.
firstname
let
lastname
=
this
.
lastname
let
login
=
this
.
login
let
email
=
this
.
email
let
password
=
this
.
password
let
confirm
=
this
.
confirmpassword
if
(
confirm
!==
password
){
window
.
alert
(
"Les mots de passe ne correspondent pas"
)
return
false
}
else
{
var
bcrypt
=
require
(
'bcryptjs'
);
var
salt
=
"$2a$08$c0GzKSB8g6.rZLF98GJvQu"
var
hash
=
bcrypt
.
hashSync
(
password
,
salt
)
let
data
=
{
"USER_FIRSTNAME"
:
firstname
,
"USER_LASTNAME"
:
lastname
,
"USER_LOGIN"
:
login
,
"USER_EMAIL"
:
email
,
"USER_PASSWORD"
:
hash
,
"USER_ROLE"
:
1
}
this
.
call
(
data
)
}
},
call
:
function
(
data
){
const
url
=
"http://localhost/projet-cdaw/backend/MVC/api.php/user"
var
params
=
{
method
:
'POST'
,
body
:
JSON
.
stringify
(
data
)
};
console
.
log
(
params
.
body
.
lastname
)
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
console
.
log
(
data
))
}
},
}
</
script
>
frontend/src/views/Login.vue
View file @
b8ee91b9
...
...
@@ -79,7 +79,6 @@ export default {
check
:
function
(){
let
login
=
this
.
login
let
password
=
this
.
password
var
bcrypt
=
require
(
'bcryptjs'
);
var
salt
=
"$2a$08$c0GzKSB8g6.rZLF98GJvQu"
var
hash
=
bcrypt
.
hashSync
(
password
,
salt
)
...
...
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