Вот мой html:
```html
<div class="tab login-tab">
    <div class="tab-title">Login or register</div>
    <div class="login-boxes-container">
        <div class="login-box">
            <input class="login-field" placeholder="login">
            <input type="password" class="password-field" placeholder="password">
        </div>
        <div class="login-buttons">
            <button class="login-btn" id="login-btn">Login</button>
            or
            <button class="login-btn" id="register-btn">Register</button>
        </div>
    </div>
</div>
```

Вот код сервера:
```py
from flask import Flask, request, jsonify, render_template

from DatabaseManager import DatabaseManager

app = Flask(__name__)

db_manager = DatabaseManager()


# Эндпоинты API

# Регистрация пользователя
@app.route('/api/register', methods=['POST'])
def register():
    data = request.json
    username = data.get('username')
    password = data.get('password')
    if username and password:
        success = db_manager.create_account(username, password)
        if success:
            return jsonify({'message': 'Account created successfully'}), 201
        else:
            return jsonify({'message': 'Username already exists'}), 400
    else:
        return jsonify({'message': 'Username and password required'}), 400


# Аутентификация пользователя
@app.route('/api/login', methods=['POST'])
def login():
    data = request.json
    username = data.get('username')
    password = data.get('password')
    if username and password:
        valid = db_manager.verify_account(username, password)
        if valid:
            return jsonify({'message': 'Login successful'}), 200
        else:
            return jsonify({'message': 'Invalid credentials'}), 401
    else:
        return jsonify({'message': 'Username and password required'}), 400


# Создание нового проекта
@app.route('/api/projects', methods=['POST'])
def create_project():
    data = request.json
    author_id = data.get('author_id')
    user_ids = data.get('user_ids', [])
    project_data = data.get('data', {})
    if author_id:
        project_id = db_manager.create_project(author_id, user_ids, project_data)
        return jsonify({'message': 'Project created', 'project_id': project_id}), 201
    else:
        return jsonify({'message': 'Author ID is required'}), 400


# Получение информации о проекте
@app.route('/api/projects/<int:project_id>', methods=['GET'])
def get_project(project_id):
    project = db_manager.get_project(project_id)
    if project:
        return jsonify(project), 200
    else:
        return jsonify({'message': 'Project not found'}), 404


# Обновление проекта
@app.route('/api/projects/<int:project_id>', methods=['PUT'])
def update_project(project_id):
    data = request.json
    user_ids = data.get('user_ids')
    project_data = data.get('data')
    db_manager.update_project(project_id, user_ids=user_ids, data=project_data)
    return jsonify({'message': 'Project updated'}), 200


# Удаление проекта
@app.route('/api/projects/<int:project_id>', methods=['DELETE'])
def delete_project(project_id):
    db_manager.delete_project(project_id)
    return jsonify({'message': 'Project deleted'}), 200


# Главная страница
@app.route('/main')
def index():
    return render_template('index.html')


if __name__ == '__main__':
    app.run(debug=True, host="0.0.0.0", port=8081)
```
Можешь пожалуйста написать код login.js с jqeury, чтобы он мог обрабатывать логин/регистрацию, а также вход в аккаунт с сохранением токена в куки.