Compare commits

..

No commits in common. "385640c10ea922fe324ffb9c64867c3e49c47d6d" and "a0c38a8d590d15464aa801814254a63cda05b755" have entirely different histories.

4 changed files with 53 additions and 80 deletions

View File

@ -1,10 +1,32 @@
<script setup> <script setup>
import Req from "./Request.vue" import Req from "./Request.vue"
import { getRegisters } from '@/rest/ServiceInscription.js' const requests_example = [ {
id:0,
const requests_example = getRegisters(); type:"Inscription",
lastName:"DoefenschmirtzLEMAGNIFIQUE",
firstName:"Jhon",
address: "Radiator Springs",
country: "USA",
birthdate:"2004-02-02",
email:"JohnDoe@gmail.com",
cursus:"IT",
degree:"BAC1",
},
{
id:1,
type:"ReInscription",
lastName:"Doe",
firstName:"Jane",
address: "Radiator Springs",
country: "USA",
birthdate:"2004-03-03",
email:"JaneDoe@gmail.com",
cursus:"Psychology",
degree:"BAC1",
}]
</script> </script>
<template> <template>
<Req v-for="item of requests_example"/> <Req v-for="item of requests_example" v-bind="item">
</Req>
</template> </template>

View File

@ -7,16 +7,23 @@
const loginPage= ref(true) const loginPage= ref(true)
const page = ref(0) const page = ref(0)
const emailID=ref("")
const passwordIN=ref("")
const submitValue= ref(i18n("login.guest.submit")) const submitValue= ref(i18n("login.guest.submit"))
const surname=ref("") const surname=ref("")
const firstname=ref("") const firstname=ref("")
const password=ref("") const passwordOUT=ref("")
const passwordConfirm=ref("") const passwordConfirm=ref("")
const birthday=ref("") const birthday=ref("")
const email=ref("") const emailOUT=ref("")
const address=ref("") const address=ref("")
const country=ref("") const country=ref("")
const cursus=ref("") const cursus=ref("")
const loginInfos = [{_emailID:emailID},{_passwordIN:passwordIN}]
const registerInfos= [{_surname:surname},{_firstname:firstname},{_birthday:birthday},{_passwordOUT:passwordOUT},
{_passwordConfirm:passwordConfirm},{_emailOUT:emailOUT},{_address:address},{_country:country},{_cursus:cursus}]
const imageSaved = ref(false) const imageSaved = ref(false)
const ppData = ref(false) const ppData = ref(false)
@ -27,17 +34,17 @@
<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(emailID, passwordIN)"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>
<div class="inputBox"> <div class="inputBox">
<p>ID / {{i18n("login.guest.email")}}</p> <p>ID / {{i18n("login.guest.email")}}</p>
<input type="text" v-model="email"> <input type="text" v-model="emailID">
</div> </div>
<div class="inputBox"> <div class="inputBox">
<p>{{i18n("login.guest.password")}}</p> <p>{{i18n("login.guest.password")}}</p>
<input type="password" v-model="password"> <input type="password" v-model="passwordIN">
</div> </div>
<div class="register"> <div class="register">
<a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a> <a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a>
@ -49,7 +56,7 @@
</div> </div>
<div v-else> <div v-else>
<form @submit.prevent="register(firstname, surname, birthday, password, mail, address, country, cursus)" class="form"> <form @submit.prevent="register(surname,firstname,emailOUT)" 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>
@ -68,12 +75,11 @@
</div> </div>
<div class="inputBox"> <div class="inputBox">
<p>{{i18n("login.guest.password")}}</p> <p>{{i18n("login.guest.password")}}</p>
<input type="password" v-model="password"> <input type="password" v-model="passwordOUT">
</div> </div>
<div class="inputBox"> <div class="inputBox">
<p>{{i18n("login.guest.confirm")}} {{i18n("login.guest.password")}}</p> <p>{{i18n("login.guest.confirm")}} {{i18n("login.guest.password")}}</p>
<input type="password" v-model="passwordConfirm"> <input type="password" v-model="passwordConfirm">
<!-- TODO: Verify password is same as passwordConfirm -->
</div> </div>
<div class="switchpage"> <div class="switchpage">
@ -87,7 +93,7 @@
<div v-else> <div v-else>
<div class="inputBox"> <div class="inputBox">
<p>{{i18n("login.guest.email")}}</p> <p>{{i18n("login.guest.email")}}</p>
<input type="mail" v-model="email"> <input type="mail" v-model="emailOUT">
</div> </div>
<div class="inputBox"> <div class="inputBox">
<p>{{i18n("login.guest.address")}}</p> <p>{{i18n("login.guest.address")}}</p>

View File

@ -3,34 +3,28 @@
* *
* TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future. * TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future.
*/ */
import { restGet, restPost } from './restConsumer.js' import { restGet } from './restConsumer.js'
/** /**
* create a new register requests that can be recovered by the registering service * create a new register requests that can be recovered by the registering service
* TODO: add info in the Object (I don't know what will be needed) * TODO: add info in the Object (I don't know what will be needed)
*/ */
export async function createRegister(){ export async function createRegister(){
return restPost("/requests/register"); return restPost("/requests/register"});
} }
/** /**
* list all register request in a list of Objects * list all register request in a list of Objects
* Shall return a list of */
* - id export async function getRegisters(){
* - type return restGet("/requests/register")
* - lastName }
* - firstName
* - address /**
* - country * Get info on a particular registering request
* - birthdate
* - email
* - cursus
* - degree
*/ */
export async function getRegisters(id){ export async function getRegisters(id){
if(id != null) return restGet("/requests/register/" + id);
return restGet("/requests/register/" + id);
return restGet("/requests/register")
} }
/** /**

View File

@ -4,57 +4,8 @@ export async function login(user, pass, exp){
return restPost("/login", {identifier: user, password: pass, expirationDate: exp}); return restPost("/login", {identifier: user, password: pass, expirationDate: exp});
} }
/** export async function register(user, pass, mail){
* Register a user (tokenless) return restPost("/user", {name: user, password: pass, mail: mail});
*
* @param firstname
* @param lastname
* @param birthdate
* @param password
* @param mail
* @param address
* @param country
* @param cursus
* @param imageId id of the image in database returned when uploaded
*/
export async function register(firstname, lastname, birthDate, password, email, address, country, cursus, imageId){
return restPost("/register", {
firstname: firstname,
lastname: lastname,
birthDate: birthDate,
password: password,
email: email,
address: address,
country: country,
cursus: cursus
});
}
/**
* Register a user (by secretary)
*
* @param firstname
* @param lastname
* @param birthdate
* @param password
* @param mail
* @param address
* @param country
* @param imageId id of the image in database returned when uploaded
*
* PS: the password is not is not required as it is generated by the backend and sent to the user
* by mail. it's up to the user to change it if he cares about security
*/
export async function createUser(firstname, lastname, birthDate, email, address, country, role, imageId){
return restPost("/user", {
firstname: firstname,
lastname: lastname,
birthDate: birthDate,
password: password,
email: email,
address: address,
country: country,
});
} }
/** /**