-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from philippebeck/dev
Release 0.7.0
- Loading branch information
Showing
23 changed files
with
576 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<template> | ||
<form> | ||
<!-- User Email --> | ||
<FieldElt id="email" | ||
v-model:value="email" | ||
info="Indicate your Email" | ||
@keyup.enter="forgotPass()" | ||
type="email" | ||
required> | ||
<template #legend> | ||
</template> | ||
<template #label> | ||
This email must have been registered before | ||
</template> | ||
</FieldElt> | ||
|
||
<!-- Security --> | ||
<div id="recaptcha" | ||
class="g-recaptcha" | ||
data-sitekey=""> | ||
</div> | ||
|
||
<!-- Send Password Button --> | ||
<BtnElt type="button" | ||
content="Send" | ||
@click="forgotPass()" | ||
class="btn-orange"> | ||
<template #btn> | ||
<i class="fa-regular fa-paper-plane fa-lg"></i> | ||
</template> | ||
</BtnElt> | ||
</form> | ||
</template> | ||
|
||
<script> | ||
import constants from "/constants"; | ||
export default { | ||
name: "ForgotPass", | ||
data() { | ||
return { | ||
email: "" | ||
} | ||
}, | ||
methods: { | ||
/** | ||
* FORGOT PASSWORD | ||
*/ | ||
forgotPass() { | ||
if (this.$serve.checkEmail(this.email) && | ||
confirm(constants.FORGOT_CONFIRM)) { | ||
let message = new FormData(); | ||
message.append("email", this.email); | ||
message.append("subject", constants.FORGOT_SUBJECT); | ||
message.append("text", constants.FORGOT_TEXT); | ||
this.$serve.postData("/api/users/forgot", message) | ||
.then(() => { | ||
alert(message.get("subject") + " sended !"); | ||
this.$router.push("/login"); | ||
}) | ||
.catch(err => { console.log(err) }); | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<template> | ||
<form class="form"> | ||
|
||
<!-- User Email --> | ||
<FieldElt id="email" | ||
v-model:value="email" | ||
info="Indicate your Email" | ||
@keyup.enter="login()" | ||
type="email"> | ||
<template #legend> | ||
</template> | ||
<template #label> | ||
This email must have been registered before | ||
</template> | ||
</FieldElt> | ||
|
||
<!-- User Pass --> | ||
<FieldElt id="pass" | ||
v-model:value="pass" | ||
info="Indicate your Password" | ||
@keyup.enter="login()" | ||
type="password"> | ||
<template #legend> | ||
Password | ||
</template> | ||
<template #label> | ||
You can use the Forgot Password feature if needed | ||
</template> | ||
</FieldElt> | ||
|
||
<!-- Security --> | ||
<div id="recaptcha" | ||
class="g-recaptcha" | ||
data-sitekey=""> | ||
</div> | ||
|
||
<!-- Login Button --> | ||
<BtnElt type="button" | ||
content="Enter" | ||
@click="login()" | ||
class="btn-green"> | ||
<template #btn> | ||
<i class="fa-solid fa-right-to-bracket fa-lg"></i> | ||
</template> | ||
</BtnElt> | ||
</form> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "SignIn", | ||
data() { | ||
return { | ||
email: "", | ||
pass: "" | ||
} | ||
}, | ||
methods: { | ||
/** | ||
* USER LOGIN | ||
*/ | ||
login() { | ||
if (this.$serve.checkEmail(this.email) && | ||
this.$serve.checkPass(this.pass)) { | ||
let auth = new FormData(); | ||
auth.append("email", this.email); | ||
auth.append("pass", this.pass); | ||
this.$serve.postData("/api/users/login", auth) | ||
.then((res) => { | ||
let token = JSON.stringify(res.token); | ||
let userId = JSON.stringify(res.userId); | ||
localStorage.setItem("userToken", token); | ||
localStorage.setItem("userId", userId); | ||
this.$router.go("/"); | ||
}) | ||
.catch(err => { console.log(err) }); | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<h1>SignUp</h1> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "ForgotPass" | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.