1
0
forked from PGL/Clyde

small commit but its for the big merge+ verif psswrd and confirm in login

This commit is contained in:
Wawilski 2024-03-16 11:52:31 +01:00
parent d5e4387303
commit 47a0c97f3d
2 changed files with 29 additions and 13 deletions

View File

@ -3,6 +3,9 @@
import i18n from '@/i18n.js'
import { login , register } from '@/rest/Users.js'
import { uploadProfilePicture } from '@/rest/uploads.js'
import {toast} from 'vue3-toastify'
import 'vue3-toastify/dist/index.css';
const loginPage= ref(true)
const page = ref(0)
@ -20,6 +23,22 @@
const imageSaved = 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>
@ -27,7 +46,7 @@
<div class='loginBox'>
<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;">
{{i18n("login.guest.signin")}}
</h1>
@ -49,7 +68,7 @@
</div>
<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;">
{{i18n("login.guest.welcome")}}
</h1>
@ -77,7 +96,7 @@
</div>
<div class="switchpage">
<button @click="page++">{{i18n("login.guest.nextpage")}}</button>
<button @click="verifyInputs();">{{i18n("login.guest.nextpage")}}</button>
</div>
<div @click="(loginPage=!loginPage) && (page=0)" class="register">
@ -110,7 +129,9 @@
</select>
</div>
<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 class="switchpage">
<button @click="page--">{{i18n("login.guest.lastpage")}}</button>

View File

@ -6,15 +6,10 @@
/*
const user = getUser();
*/
const user = getUser();
/*reactive({
const user=reactive({
profilePicture:"/Clyde.png",
lastName:"Ghost",
firstName:"Clyde",
lastname:"Ghost",
firstname:"Clyde",
role:"student",
address: "Radiator Springs",
email:"ClydeGhost@gmail.com",
@ -93,7 +88,7 @@ function getPP(){
<div class="globalInfos">
<div v-if="modif==false" class="infosContainer" >
<div>
{{user.firstName}} {{user.lastName.toUpperCase()}}
{{user.firstname}} {{user.lastname.toUpperCase()}}
</div>
<div>
E-mail: {{user.email}}