Compare commits

..

10 Commits

Author SHA1 Message Date
dbbf74f2c3 Merge pull request 'tonitch/front/User_API' (#56) from tonitch/front/User_API into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m11s
Build and test backend / Test-backend (push) Successful in 1m22s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m18s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
Reviewed-on: #56
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-07 14:12:49 +01:00
aaaba0ddf3
User api first draft finished
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m55s
Build and test backend / Test-backend (pull_request) Successful in 1m52s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 19s
2024-03-06 14:08:39 +01:00
e158fa1f87
backbone for login
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m52s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 32s
2024-03-06 09:00:55 +01:00
6289be529a
package-lock was forgoten 2024-03-06 08:59:08 +01:00
1f69040436
adding patch to restConsumer 2024-03-06 08:59:08 +01:00
56a14a3e8a
adding toast on requests 2024-03-06 08:59:06 +01:00
d1b4023d92
adding register 2024-03-05 14:58:56 +01:00
837db9aba9
backbone for login 2024-03-05 14:10:13 +01:00
09d5e1c293
Document rest
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m55s
Build and test backend / Test-backend (pull_request) Successful in 1m50s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 19s
2024-03-05 11:48:04 +01:00
8c2397c4cf
Base for rest api utilisation
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m54s
Build and test backend / Test-backend (pull_request) Successful in 1m52s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
The restConsumer will be the base, then I will create a js file per
"object" (for instance there will be users.js with all endpoints for
users using the restConsumer.js)
2024-03-05 00:15:52 +01:00
2 changed files with 41 additions and 4 deletions

View File

@ -1,16 +1,25 @@
<script setup>
import { ref } from 'vue'
import { login } from './rest/Users.js'
const username = ref("");
const password = ref("");
</script>
<template>
<body>
<div class="logBoxCenterer">
<div class='loginBox'>
<div class="form">
<form @submit.prevent="login(username, password)" class="form">
<h1 style="color:rgb(239,60,168); font-family: sans-serif;">SIGN IN</h1>
<div class="inputBox">
<p>USERNAME</p>
<input type="text" required>
<input v-model="username" type="text" required>
</div>
<div class="inputBox">
<p>PASSWORD</p>
<input type="password" required>
<input v-model=password type="password" required>
</div>
<div class="register">
<a>Register</a>
@ -18,7 +27,7 @@
<div class="inputBox">
<input type="submit" value="Login">
</div>
</div>
</form>
</div>
</div>
</body>

View File

@ -0,0 +1,28 @@
import { restGet, restPost } from './restConsumer.js'
export async function login(user, pass, exp){
return restPost("/login", {login: user, password: pass, expiration: exp});
}
export async function register(user, pass, mail){
return restPost("/user", {name: user, password: pass, mail: mail});
restPost("/login", {login: user, password: pass, expiration: exp})
}
/**
* get informations on a specific user.
* Leaving the id empty will return the user's value based on his token
* if the user is not authenticated. then an empty array should be returned
*/
export async function getUser(id){
const endpoint = "/user" + id != null ? "/" + id : "";
return restGet(endpoint);
}
/**
* Reserved for secretary roles. Allow to list all user on the plateform
*/
export async function getAllUsers(){
return restGet("/users");
}