v8.0.1: Change forbidden error to unauthorized for subscription check

Updated the error code returned when a user's subscription is either inactive or on a Home plan from 403 (Forbidden) to 401 (Unauthorized). This makes the response more semantically accurate, indicating that authentication is required and has failed.
pull/399/head
Aidaho 2024-09-12 10:11:39 +03:00
parent 8964652375
commit 902f94d052
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ def before_request():
""" Protect all the API endpoints. """
user_subscription = roxywi_common.return_user_subscription()
if user_subscription['user_status'] == 0 or user_subscription['user_plan'] == 'user':
abort(403, 'Your subscription is not active or you are on a Home plan.')
abort(401, 'Your subscription is not active or you are on a Home plan.')
pass