Loading capif_backend/backoffice_service/controllers/login.py +3 −0 Original line number Diff line number Diff line #!/usr/bin/env python3 from flask import Blueprint, jsonify, request from flask_jwt_extended import JWTManager, create_access_token, create_refresh_token, get_jwt_identity, jwt_required from flask_cors import cross_origin # create blueprint backoffice_routes access_routes = Blueprint("acces_routes", __name__) @access_routes.route("/login", methods=["POST"]) @cross_origin() def login(): username = request.form.get("username", None) password = request.form.get("password", None) Loading @@ -24,6 +26,7 @@ def login(): return jsonify(access_token=access_token, refresh_token=refresh_token) @access_routes.route('/refresh', methods=["POST"]) @cross_origin() @jwt_required def refresh(): current_user = get_jwt_identity() Loading Loading
capif_backend/backoffice_service/controllers/login.py +3 −0 Original line number Diff line number Diff line #!/usr/bin/env python3 from flask import Blueprint, jsonify, request from flask_jwt_extended import JWTManager, create_access_token, create_refresh_token, get_jwt_identity, jwt_required from flask_cors import cross_origin # create blueprint backoffice_routes access_routes = Blueprint("acces_routes", __name__) @access_routes.route("/login", methods=["POST"]) @cross_origin() def login(): username = request.form.get("username", None) password = request.form.get("password", None) Loading @@ -24,6 +26,7 @@ def login(): return jsonify(access_token=access_token, refresh_token=refresh_token) @access_routes.route('/refresh', methods=["POST"]) @cross_origin() @jwt_required def refresh(): current_user = get_jwt_identity() Loading