added comments
This commit is contained in:
@@ -3,11 +3,13 @@
|
||||
class AuthService {
|
||||
private API_BASE = '/api/auth'
|
||||
|
||||
// Hashes the password before sending it to the backend
|
||||
private hashPassword(password: string) {
|
||||
// TODO: password hashing
|
||||
return password
|
||||
}
|
||||
|
||||
// Logs in with email and password, returning the parsed JSON response.
|
||||
async login(email: string, password: string) {
|
||||
const response = await fetch(`${this.API_BASE}/login`, {
|
||||
method: 'POST',
|
||||
@@ -25,6 +27,7 @@ class AuthService {
|
||||
return await response.json()
|
||||
}
|
||||
|
||||
// Registers a new user, returning the parsed JSON response.
|
||||
async register(name: string, email: string, password: string) {
|
||||
const response = await fetch(`${this.API_BASE}/register`, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user