You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
503 B
23 lines
503 B
from flask import blueprints
|
|
from flask import jsonify
|
|
from flask import make_response
|
|
from flask_api import status
|
|
from flask_login import login_required
|
|
from flask_login import logout_user
|
|
|
|
bp = blueprints.Blueprint("logout", __name__)
|
|
|
|
|
|
@bp.route(
|
|
rule="/logout",
|
|
methods=["DELETE"],
|
|
)
|
|
@login_required
|
|
def logout():
|
|
# Remove the user information from the session
|
|
logout_user()
|
|
|
|
return make_response(
|
|
jsonify(message="logout successful"),
|
|
status.HTTP_200_OK,
|
|
)
|
|
|