Skip to content

Commit d86c2ec

Browse files
Potential fix for code scanning alert no. 16: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 63c7bdb commit d86c2ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/flask/routes/auth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,6 @@ def invalidate():
7373
return jsonify({"message": "Session invalidated successfully"}), 200
7474

7575
except Exception as e:
76-
return jsonify({"error": f"Invalidation failed: {str(e)}"}), 500
76+
logger.error("Exception in invalidate: %s\n%s", str(e), traceback.format_exc())
77+
return jsonify({"error": "Invalidation failed. Please try again later."}), 500
7778

0 commit comments

Comments
 (0)