-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CSRF exempts in the LTI Tool v1.3
In Django's class-based views, function decorators must be used with `method_decorator`. https://docs.djangoproject.com/en/3.2/topics/class-based-views/intro/#decorating-the-class Move the `csrf_exempt` for the class `LtiLaunchView` from urls.py to the view class definition so that it is more consistent with the other LTI Tool views. The same view also requires the `xframe_options_exempt` decorator. Class `LtiSessionMixin` does not need `csrf_exempt`. Most of its child classes are able to normally check CSRF tokens because the HTML forms are first rendered in A+. Class `LtiExerciseView` needs both `csrf_exempt` and `xframe_options_exempt`. * `csrf_exempt` is needed since it is used in class `ExerciseView` and the exercise forms loaded from assessment services do not include any CSRF tokens. * `xframe_options_exempt` is needed since LTI Tools may be embedded in iframes in the LTI Platform. Fixes #1099
- Loading branch information
1 parent
1a4b747
commit 7e4bd40
Showing
2 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters