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
5b0d5cf4
Commit
5b0d5cf4
authored
Dec 01, 2020
by
thibaut-felten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log in
parent
c5703bcc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
85 deletions
+133
-85
LoginController.class.php
backend/MVC/controller/LoginController.class.php
+1
-1
package-lock.json
frontend/package-lock.json
+91
-79
package.json
frontend/package.json
+2
-0
Login.vue
frontend/src/views/Login.vue
+39
-5
No files found.
backend/MVC/controller/LoginController.class.php
View file @
5b0d5cf4
...
...
@@ -24,7 +24,7 @@ class LoginController extends Controller {
$user
=
User
::
tryLogin
(
$json
->
login
);
if
(
empty
(
$user
)
||
!
hash_equals
(
$json
->
pwd
,
$user
->
USER_PASSWORD
))
{
$r
=
new
Response
(
42
2
,
"wrong credentials"
);
$r
=
new
Response
(
42
4
,
"wrong credentials"
);
$r
->
send
();
}
...
...
frontend/package-lock.json
View file @
5b0d5cf4
...
...
@@ -1733,16 +1733,6 @@
"integrity"
:
"sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A=="
,
"dev"
:
true
},
"ansi-styles"
:
{
"version"
:
"4.3.0"
,
"resolved"
:
"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
,
"integrity"
:
"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-convert"
:
"^2.0.1"
}
},
"cacache"
:
{
"version"
:
"13.0.1"
,
"resolved"
:
"https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz"
,
...
...
@@ -1769,34 +1759,6 @@
"unique-filename"
:
"^1.1.1"
}
},
"chalk"
:
{
"version"
:
"4.1.0"
,
"resolved"
:
"https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz"
,
"integrity"
:
"sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"ansi-styles"
:
"^4.1.0"
,
"supports-color"
:
"^7.1.0"
}
},
"color-convert"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
,
"integrity"
:
"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-name"
:
"~1.1.4"
}
},
"color-name"
:
{
"version"
:
"1.1.4"
,
"resolved"
:
"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
,
"integrity"
:
"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
,
"dev"
:
true
,
"optional"
:
true
},
"find-cache-dir"
:
{
"version"
:
"3.3.1"
,
"resolved"
:
"https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz"
,
...
...
@@ -1818,25 +1780,6 @@
"path-exists"
:
"^4.0.0"
}
},
"has-flag"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz"
,
"integrity"
:
"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
,
"dev"
:
true
,
"optional"
:
true
},
"loader-utils"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz"
,
"integrity"
:
"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"big.js"
:
"^5.2.2"
,
"emojis-list"
:
"^3.0.0"
,
"json5"
:
"^2.1.2"
}
},
"locate-path"
:
{
"version"
:
"5.0.0"
,
"resolved"
:
"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz"
,
...
...
@@ -1901,16 +1844,6 @@
"minipass"
:
"^3.1.1"
}
},
"supports-color"
:
{
"version"
:
"7.2.0"
,
"resolved"
:
"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz"
,
"integrity"
:
"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"has-flag"
:
"^4.0.0"
}
},
"terser-webpack-plugin"
:
{
"version"
:
"2.3.8"
,
"resolved"
:
"https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz"
,
...
...
@@ -1927,18 +1860,6 @@
"terser"
:
"^4.6.12"
,
"webpack-sources"
:
"^1.4.3"
}
},
"vue-loader-v16"
:
{
"version"
:
"npm:vue-loader@16.0.0"
,
"resolved"
:
"https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0.tgz"
,
"integrity"
:
"sha512-R20f4PWe34dqhTZ9tkyFd6nfjxEbLBHbFOsN38qg0Jl8GKMfmoyc/E8vVjjRkunE6qCydpPoH7f/tW13bD6+JA=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"chalk"
:
"^4.1.0"
,
"hash-sum"
:
"^2.0.0"
,
"loader-utils"
:
"^2.0.0"
}
}
}
},
...
...
@@ -2669,6 +2590,11 @@
"tweetnacl"
:
"^0.14.3"
}
},
"bcryptjs"
:
{
"version"
:
"2.4.3"
,
"resolved"
:
"https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz"
,
"integrity"
:
"sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms="
},
"bfj"
:
{
"version"
:
"6.1.2"
,
"resolved"
:
"https://registry.npmjs.org/bfj/-/bfj-6.1.2.tgz"
,
...
...
@@ -10886,6 +10812,11 @@
"integrity"
:
"sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
,
"dev"
:
true
},
"vee-validate"
:
{
"version"
:
"4.0.2"
,
"resolved"
:
"https://registry.npmjs.org/vee-validate/-/vee-validate-4.0.2.tgz"
,
"integrity"
:
"sha512-4NxqfM/oBpCfKlXb4LJFdViBZqRmn5bl5SaaNRDEFNo1IINRT5iugu8OalKcQ2/JsqGYHoVXVtAMhQRqnkmrxw=="
},
"vendors"
:
{
"version"
:
"1.0.4"
,
"resolved"
:
"https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz"
,
...
...
@@ -10975,6 +10906,87 @@
}
}
},
"vue-loader-v16"
:
{
"version"
:
"npm:vue-loader@16.1.0"
,
"resolved"
:
"https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.0.tgz"
,
"integrity"
:
"sha512-fTtCdI7VeyNK0HP4q4y9Z9ts8TUeaF+2/FjKx8CJ/7/Oem1rCX7zIJe+d+jLrVnVNQjENd3gqmANraLcdRWwnQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"chalk"
:
"^4.1.0"
,
"hash-sum"
:
"^2.0.0"
,
"loader-utils"
:
"^2.0.0"
},
"dependencies"
:
{
"ansi-styles"
:
{
"version"
:
"4.3.0"
,
"resolved"
:
"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
,
"integrity"
:
"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-convert"
:
"^2.0.1"
}
},
"chalk"
:
{
"version"
:
"4.1.0"
,
"resolved"
:
"https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz"
,
"integrity"
:
"sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"ansi-styles"
:
"^4.1.0"
,
"supports-color"
:
"^7.1.0"
}
},
"color-convert"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
,
"integrity"
:
"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-name"
:
"~1.1.4"
}
},
"color-name"
:
{
"version"
:
"1.1.4"
,
"resolved"
:
"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
,
"integrity"
:
"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
,
"dev"
:
true
,
"optional"
:
true
},
"has-flag"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz"
,
"integrity"
:
"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
,
"dev"
:
true
,
"optional"
:
true
},
"loader-utils"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz"
,
"integrity"
:
"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"big.js"
:
"^5.2.2"
,
"emojis-list"
:
"^3.0.0"
,
"json5"
:
"^2.1.2"
}
},
"supports-color"
:
{
"version"
:
"7.2.0"
,
"resolved"
:
"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz"
,
"integrity"
:
"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"has-flag"
:
"^4.0.0"
}
}
}
},
"vue-router"
:
{
"version"
:
"3.4.9"
,
"resolved"
:
"https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz"
,
...
...
frontend/package.json
View file @
5b0d5cf4
...
...
@@ -8,7 +8,9 @@
"lint"
:
"vue-cli-service lint"
},
"dependencies"
:
{
"bcryptjs"
:
"^2.4.3"
,
"core-js"
:
"^3.6.5"
,
"vee-validate"
:
"^4.0.2"
,
"vue"
:
"^2.6.11"
,
"vue-awesome"
:
"^4.1.0"
,
"vue-router"
:
"^3.2.0"
...
...
frontend/src/views/Login.vue
View file @
5b0d5cf4
...
...
@@ -3,14 +3,14 @@
<div
class=
"row _centered"
>
<div
class=
"column _600"
>
<h1>
Login
</h1>
<form
action=
"/"
method=
"post"
class=
"form
"
>
<form
id=
"loginForm"
class=
"form"
v-on:submit
.
prevent=
"check
"
>
<div
class=
"row lpad"
>
<label
for=
"Login"
>
Login
</label>
<input
type=
"text"
name=
"Login
"
required
>
<input
v-model=
"login"
type=
"text"
name=
"Login"
id=
"loginValue
"
required
>
</div>
<div
class=
"row lpad"
>
<label
for=
"Password"
>
Mot de passe
</label>
<input
type=
"password"
name=
"Password
"
required
>
<input
v-model=
"password"
type=
"password"
name=
"Password"
id=
"passwordValue
"
required
>
</div>
<div
class=
"row lpad"
>
<button
type=
"submit"
class=
"btn"
>
Valider
</button>
...
...
@@ -74,7 +74,41 @@
<
script
>
export
default
{
name
:
'Login'
}
name
:
'Login'
,
methods
:
{
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
)
this
.
call
(
login
,
hash
)
},
call
:
function
(
login
,
password
){
const
url
=
"http://localhost/projet-cdaw/backend/MVC/api.php/login"
let
data
=
{
login
:
login
,
pwd
:
password
}
console
.
log
(
JSON
.
stringify
(
data
))
var
params
=
{
method
:
'POST'
,
body
:
JSON
.
stringify
(
data
)
};
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
console
.
log
(
data
))
}
},
}
</
script
>
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