small commit but its for the big merge+ verif psswrd and confirm in login
This commit is contained in:
parent
d5e4387303
commit
47a0c97f3d
@ -3,6 +3,9 @@
|
|||||||
import i18n from '@/i18n.js'
|
import i18n from '@/i18n.js'
|
||||||
import { login , register } from '@/rest/Users.js'
|
import { login , register } from '@/rest/Users.js'
|
||||||
import { uploadProfilePicture } from '@/rest/uploads.js'
|
import { uploadProfilePicture } from '@/rest/uploads.js'
|
||||||
|
import {toast} from 'vue3-toastify'
|
||||||
|
import 'vue3-toastify/dist/index.css';
|
||||||
|
|
||||||
|
|
||||||
const loginPage= ref(true)
|
const loginPage= ref(true)
|
||||||
const page = ref(0)
|
const page = ref(0)
|
||||||
@ -20,6 +23,22 @@
|
|||||||
|
|
||||||
const imageSaved = ref(false)
|
const imageSaved = ref(false)
|
||||||
const ppData = ref(false)
|
const ppData = ref(false)
|
||||||
|
|
||||||
|
function goBackHome(){
|
||||||
|
window.location.href='#home'
|
||||||
|
}
|
||||||
|
|
||||||
|
function verifyInputs(){
|
||||||
|
if(password.value==passwordConfirm.value){
|
||||||
|
page.value++;
|
||||||
|
return toast('Password and Confirm Password are correct.', {
|
||||||
|
|
||||||
|
type: "success",});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return toast('Password and Confirm Password are different',{type: "error",});
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +46,7 @@
|
|||||||
<div class='loginBox'>
|
<div class='loginBox'>
|
||||||
|
|
||||||
<div v-if="loginPage">
|
<div v-if="loginPage">
|
||||||
<form @submit.prevent="login(email, password)"class="form">
|
<form @submit.prevent="login(email, password);goBackHome();"class="form">
|
||||||
<h1 style="color:rgb(239,60,168); font-family: sans-serif;">
|
<h1 style="color:rgb(239,60,168); font-family: sans-serif;">
|
||||||
{{i18n("login.guest.signin")}}
|
{{i18n("login.guest.signin")}}
|
||||||
</h1>
|
</h1>
|
||||||
@ -49,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<form @submit.prevent="register(firstname, surname, birthday, password, mail, address, country, cursus)" class="form">
|
<form class="form">
|
||||||
<h1 style="color:rgb(239,60,168); font-family: sans-serif; text-align:center;">
|
<h1 style="color:rgb(239,60,168); font-family: sans-serif; text-align:center;">
|
||||||
{{i18n("login.guest.welcome")}}
|
{{i18n("login.guest.welcome")}}
|
||||||
</h1>
|
</h1>
|
||||||
@ -77,7 +96,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="switchpage">
|
<div class="switchpage">
|
||||||
<button @click="page++">{{i18n("login.guest.nextpage")}}</button>
|
<button @click="verifyInputs();">{{i18n("login.guest.nextpage")}}</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div @click="(loginPage=!loginPage) && (page=0)" class="register">
|
<div @click="(loginPage=!loginPage) && (page=0)" class="register">
|
||||||
@ -110,7 +129,9 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div style="align-self:center;" class="inputBox">
|
<div style="align-self:center;" class="inputBox">
|
||||||
<button style="margin-top:25px;" @click="console.log(outputs)">{{i18n("login.guest.submit")}}</button>
|
<button style="margin-top:25px;" @click="console.log(outputs);register(firstname, surname, birthday, password, mail, address, country, cursus);">
|
||||||
|
{{i18n("login.guest.submit")}}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="switchpage">
|
<div class="switchpage">
|
||||||
<button @click="page--">{{i18n("login.guest.lastpage")}}</button>
|
<button @click="page--">{{i18n("login.guest.lastpage")}}</button>
|
||||||
|
@ -6,15 +6,10 @@
|
|||||||
/*
|
/*
|
||||||
const user = getUser();
|
const user = getUser();
|
||||||
*/
|
*/
|
||||||
const user = getUser();
|
const user=reactive({
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*reactive({
|
|
||||||
profilePicture:"/Clyde.png",
|
profilePicture:"/Clyde.png",
|
||||||
lastName:"Ghost",
|
lastname:"Ghost",
|
||||||
firstName:"Clyde",
|
firstname:"Clyde",
|
||||||
role:"student",
|
role:"student",
|
||||||
address: "Radiator Springs",
|
address: "Radiator Springs",
|
||||||
email:"ClydeGhost@gmail.com",
|
email:"ClydeGhost@gmail.com",
|
||||||
@ -93,7 +88,7 @@ function getPP(){
|
|||||||
<div class="globalInfos">
|
<div class="globalInfos">
|
||||||
<div v-if="modif==false" class="infosContainer" >
|
<div v-if="modif==false" class="infosContainer" >
|
||||||
<div>
|
<div>
|
||||||
{{user.firstName}} {{user.lastName.toUpperCase()}}
|
{{user.firstname}} {{user.lastname.toUpperCase()}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
E-mail: {{user.email}}
|
E-mail: {{user.email}}
|
||||||
|
Loading…
Reference in New Issue
Block a user