Skip to content

Commit

Permalink
feat: Add authentication check to language-related API routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules Jean-Louis committed Oct 25, 2024
1 parent 163f9bb commit 482cfd5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ def returnAllLanguages():


@api.route("/api/languages", methods=["POST"])
@fnauth.check_auth(6)
def add_languages():
data = request.get_json()
try:
Expand All @@ -655,6 +656,7 @@ def add_languages():


@api.route("/api/language/<string:id>", methods=["PATCH"])
@fnauth.check_auth(2)
def update_language(id):
data = request.get_json()
try:
Expand All @@ -668,6 +670,7 @@ def update_language(id):


@api.route("/api/language/<string:id>", methods=["DELETE"])
@fnauth.check_auth(6)
def delete_language(id):
try:
models.Lang.query.filter_by(id=id).delete()
Expand Down

0 comments on commit 482cfd5

Please sign in to comment.