Skip to content

Commit

Permalink
Merge pull request #119 from uw-it-aca/feature/additive-1-point-3
Browse files Browse the repository at this point in the history
config exception handling
  • Loading branch information
mikeseibel authored Jan 21, 2025
2 parents ade4a48 + 03f3bc0 commit 3c62ae6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion blti/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
# SPDX-License-Identifier: Apache-2.0

from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from blti.config import get_tool_conf, get_launch_data_storage
from pylti1p3.contrib.django import DjangoOIDCLogin
import logging


logger = logging.getLogger(__name__)


def get_launch_url(request):
try:
return request.POST.get(
'target_link_uri', request.GET.get('target_link_uri'))
'target_link_uri', request.GET['target_link_uri'])
except KeyError:
raise BLTIException('Missing "target_link_uri" param')

Expand All @@ -28,4 +33,5 @@ def login(request):

return oidc_login.enable_check_cookies().redirect(target_link_uri)
except Exception as ex:
logger.error(f"LTI 1.3 login exception: {ex}")
return HttpResponse(str(ex), status=401)

0 comments on commit 3c62ae6

Please sign in to comment.