nytai commented on a change in pull request #14675:
URL: https://github.com/apache/superset/pull/14675#discussion_r633805025



##########
File path: superset/views/base.py
##########
@@ -361,6 +371,13 @@ def show_superset_errors(ex: SupersetErrorsException) -> 
FlaskResponse:
     return json_errors_response(errors=ex.errors, status=ex.status)
 
 
+# Redirect to login if the CSRF token is expired
+@superset_app.errorhandler(CSRFError)
+def refresh_csrf_token(ex: CSRFError) -> FlaskResponse:
+    logger.warning(ex)
+    return redirect(appbuilder.get_url_for_login)

Review comment:
       Yes take a look at the api docs, 
https://superset.apache.org/docs/rest-api
   
   there’s a `security/login` route as well as a csrf route (though it looks 
like the docs are not updated with that one, should be available locally at 
`/swagger/v1/`) 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to