mirror of
https://github.com/jointakahe/takahe.git
synced 2024-12-22 21:46:27 +00:00
Allow anonymous access to reading public statuses
This commit is contained in:
parent
7c34ac78ed
commit
65da6fd38a
1 changed files with 4 additions and 1 deletions
|
@ -2,7 +2,7 @@ from collections.abc import Callable
|
|||
from functools import wraps
|
||||
|
||||
from django.http import JsonResponse
|
||||
|
||||
from core.models import Config
|
||||
|
||||
def identity_required(function):
|
||||
"""
|
||||
|
@ -35,6 +35,9 @@ def scope_required(scope: str, requires_identity=True):
|
|||
# They're just logged in via cookie - give full access
|
||||
pass
|
||||
else:
|
||||
if Config.system.public_timeline and scope == "read:statuses":
|
||||
return function(request, *args, **kwargs)
|
||||
|
||||
return JsonResponse(
|
||||
{"error": "identity_token_required"}, status=401
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue