tonitch/front/User_API #56
@ -1,5 +1,10 @@
 | 
				
			|||||||
import { restGet, restPost } from './restConsumer.js'
 | 
					import { restGet, restPost } from './restConsumer.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function login(user, pass, exp){
 | 
					export async function login(user, pass, exp){
 | 
				
			||||||
	restPost("/login", {login: user, password: pass, expiration: exp})
 | 
						return restPost("/login", {login: user, password: pass, expiration: exp});
 | 
				
			||||||
 | 
						//TODO: set token in cookies
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export async function register(user, pass, mail){
 | 
				
			||||||
 | 
						return restPost("/user", {name: user, password: pass, mail: mail});
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user