initial commit
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user