Skip to content

Commit

Permalink
add privacy policy resource
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydonkrooss committed Jun 28, 2024
1 parent 117126e commit 72729b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/officehours/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def str_to_bool(val):
LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = '/'

PRIVACY_REDIRECT_URL = 'https://umich.edu/about/privacy/'

OIDC_RP_CLIENT_ID = os.getenv('OIDC_RP_CLIENT_ID')
OIDC_RP_CLIENT_SECRET = os.getenv('OIDC_RP_CLIENT_SECRET')
OIDC_OP_AUTHORIZATION_ENDPOINT = os.getenv('OIDC_OP_AUTHORIZATION_ENDPOINT')
Expand Down
3 changes: 2 additions & 1 deletion src/officehours_ui/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.conf import settings
from django.views.generic.base import RedirectView

from .views import SpaView, AuthPromptView, auth_callback_view
from .views import SpaView, AuthPromptView, auth_callback_view, privacy_policy_redirect_view


urlpatterns = [
Expand All @@ -19,4 +19,5 @@
path('callback/<backend_name>/', auth_callback_view, name='auth_callback'),
path("robots.txt", RedirectView.as_view(url='/static/robots.txt', permanent=True)),
path("favicon.ico", RedirectView.as_view(url='/static/favicon.ico', permanent=True)),
path("privacy/", privacy_policy_redirect_view, name='privacy-policy')
]
4 changes: 4 additions & 0 deletions src/officehours_ui/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.shortcuts import redirect
from django.views.generic import TemplateView
from django.conf import settings
from django.http import Http404
Expand Down Expand Up @@ -45,3 +46,6 @@ def auth_callback_view(request, backend_name: IMPLEMENTED_BACKEND_NAME):
except AttributeError:
raise Http404(f"Backend {backend_name} does not use three-legged OAuth2.")
return auth_callback(request)

def privacy_policy_redirect_view(request):
return redirect(settings.PRIVACY_REDIRECT_URL)

0 comments on commit 72729b9

Please sign in to comment.