backbone for login
This commit is contained in:
		| @ -1,16 +1,25 @@ | |||||||
|  | <script setup> | ||||||
|  | 	import { ref } from 'vue' | ||||||
|  | 	import { login } from './rest/Users.js' | ||||||
|  | 	 | ||||||
|  | 	const username = ref("");	 | ||||||
|  | 	const password = ref(""); | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
|   <body> |   <body> | ||||||
|     <div class="logBoxCenterer"> |     <div class="logBoxCenterer"> | ||||||
|       <div class='loginBox'> |       <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> |           <h1 style="color:rgb(239,60,168); font-family: sans-serif;">SIGN IN</h1> | ||||||
|           <div class="inputBox"> |           <div class="inputBox"> | ||||||
|             <p>USERNAME</p> |             <p>USERNAME</p> | ||||||
|             <input type="text" required> |             <input v-model="username" type="text" required> | ||||||
|           </div> |           </div> | ||||||
|           <div class="inputBox"> |           <div class="inputBox"> | ||||||
|             <p>PASSWORD</p> |             <p>PASSWORD</p> | ||||||
|             <input type="password" required> |             <input v-model=password type="password" required> | ||||||
|           </div> |           </div> | ||||||
|           <div class="register"> |           <div class="register"> | ||||||
|             <a>Register</a> |             <a>Register</a> | ||||||
| @ -18,7 +27,7 @@ | |||||||
|           <div class="inputBox"> |           <div class="inputBox"> | ||||||
|             <input type="submit" value="Login"> |             <input type="submit" value="Login"> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </form> | ||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|   </body> |   </body> | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								frontend/src/rest/Users.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								frontend/src/rest/Users.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | import { restGet, restPost } from './restConsumer.js' | ||||||
|  |  | ||||||
|  | export async function login(user, pass, exp){ | ||||||
|  | 	restPost("/login", {login: user, password: pass, expiration: exp}) | ||||||
|  | } | ||||||
| @ -1,4 +1,4 @@ | |||||||
| import { getCookie } from './utils.js' | import { getCookie } from '../utils.js' | ||||||
|  |  | ||||||
| const restURL = import.meta.env.PROD ? "https://clyde.herisson.ovh/api" : "http://localhost:8080" | const restURL = import.meta.env.PROD ? "https://clyde.herisson.ovh/api" : "http://localhost:8080" | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user