# Path: app/api/utils/response.py
# def replySuccess(data=None, message='Success'):
# def replyFailed(data=None, message='Failed', status=403):
# def reply(data=None, message='Success', status=200):
# 
# Path: app/api/utils/authentication.py
# def authenticate(username, password):
#     logging.info("Authenticate user {}".format(username))
#     if User().authenticate(username, password)[0] == True:
#         logging.info("User {} successfully authenticated".format(username))
#         return True
#     else:
#         logging.warning("Authentication failed for user {}".format(username))
#         return False


from pprint import pprint
from flask import Blueprint, request, jsonify
from app.api.utils import response
from flask_jwt_extended import create_access_token, get_jwt_identity, jwt_required
from app.api.utils.authentication import authenticate

auth_api = Blueprint('auth_api', __name__)

@auth_api.route('/login', methods=['POST'])
def login():
    username = request.get_json()["username"]
    password = request.get_json()["password"]

# Path: app/api/utils/response.py
# def replySuccess(data=None, message='Success'):
# def replyFailed(data=None, message='Failed', status=403):
# def reply(data=None, message='Success', status=200):
# 
# Path: app/api/utils/authentication.py
# def authenticate(username, password):
#     logging.info("Authenticate user {}".format(username))
#     if User().authenticate(username, password)[0] == True:
#         logging.info("User {} successfully authenticated".format(username))
#         return True
#     else:
#         logging.warning("Authentication failed for user {}".format(username))
#         return False


# Path: app/api/controllers/auth.py
from pprint import pprint
from flask import Blueprint, request, jsonify
from app.api.utils import response
from flask_jwt_extended import create_access_token, get_jwt_identity, jwt_required
from app.api.utils.authentication import authenticate


auth_api = Blueprint('auth_api', __name__)

@auth_api.route('/login', methods=['POST'])
def login():
    username = request.get_json()["username"]
    password = request.get_json()["password"]

    auth_resp = authenticate(username,password)