initial commit

This commit is contained in:
lennyaiko
2025-03-27 11:29:36 +01:00
commit 8e2d371218
35 changed files with 548 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from flask import Blueprint, request, jsonify
import requests
from app.utils.auth import get_headers
auth_bp = Blueprint("auth", __name__)
@auth_bp.route("/health", methods=["GET"])
def health():
return jsonify({"status": "Up"})
@auth_bp.route("/login", methods=["POST"])
def login():
data = request.json
api_url = "https://coreapi.dev.simbrellang.net/api/auth/login"
response = requests.post(api_url, json=data)
if response.status_code == 200:
return jsonify(response.json()), 200
return jsonify({"error": "Invalid credentials"}), response.status_code