Compare commits
No commits in common. "dbbf74f2c3f40a8876f8c4bb42f257e47c6e750a" and "0e7c18e088216469d00c044aa98eb569b0be2304" have entirely different histories.
dbbf74f2c3
...
0e7c18e088
@ -1,25 +1,16 @@
|
||||
<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'>
|
||||
<form @submit.prevent="login(username, password)" class="form">
|
||||
<div class="form">
|
||||
<h1 style="color:rgb(239,60,168); font-family: sans-serif;">SIGN IN</h1>
|
||||
<div class="inputBox">
|
||||
<p>USERNAME</p>
|
||||
<input v-model="username" type="text" required>
|
||||
<input type="text" required>
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<p>PASSWORD</p>
|
||||
<input v-model=password type="password" required>
|
||||
<input type="password" required>
|
||||
</div>
|
||||
<div class="register">
|
||||
<a>Register</a>
|
||||
@ -27,7 +18,7 @@
|
||||
<div class="inputBox">
|
||||
<input type="submit" value="Login">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -1,28 +0,0 @@
|
||||
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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user