fix(log): log endpoint authentication (#10435)
* fix(log): log crashes if expired or not authenticated * add auth to log endpoint
This commit is contained in:
parent
473fe1003a
commit
0aad9c6f48
|
|
@ -42,7 +42,7 @@ class AbstractEventLogger(ABC):
|
|||
@functools.wraps(f)
|
||||
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
||||
user_id = None
|
||||
if g.user:
|
||||
if hasattr(g, "user") and g.user:
|
||||
user_id = g.user.get_id()
|
||||
payload = request.form.to_dict() or {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1690,6 +1690,7 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
|
|||
|
||||
@api
|
||||
@event_logger.log_this
|
||||
@has_access
|
||||
@expose("/log/", methods=["POST"])
|
||||
def log(self) -> FlaskResponse: # pylint: disable=no-self-use
|
||||
return Response(status=200)
|
||||
|
|
|
|||
Loading…
Reference in New Issue