Skip to content

Commit

Permalink
Merge pull request #12 from N5GEH/11-redirect-admin-to-oidc-provider
Browse files Browse the repository at this point in the history
redirect admin to oidc provider
  • Loading branch information
dnikolay-ebc authored Jul 18, 2022
2 parents 3a1f5c0 + f0ec3ba commit 49f88e7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore in language detection
app/Entirety/static/bootstrap/** linguist-vendored
app/Entirety/static/htmx/** linguist-vendored
2 changes: 1 addition & 1 deletion .github/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# configuration file for automatic issue branch creation
branchName: '${issue.number}-${issue.title}'
branchName: '${issue.number}-${issue.title,}'
silent: true
autoCloseIssue: true
gitSafeReplacementChar: '-'
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
pip

```bash
cd ./app/entirety
cd ./app/Entirety
pip install -r requirements.txt
```

Expand Down Expand Up @@ -87,6 +87,8 @@ See [changelog](./docs/CHANGELOG.md) for detailed overview of changes.

[@sbanoeon](https://github.com/sbanoeon)

[@djs0109](https://github.com/djs0109)

[@dnikolay-ebc](https://github.com/dnikolay-ebc)

## License
Expand Down
2 changes: 2 additions & 0 deletions app/Entirety/entirety/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
handler403 = "entirety.views.custom_permission_denied_view"
handler400 = "entirety.views.custom_bad_request_view"


urlpatterns = [
path("admin/login/", views.CustomLogin.as_view()),
path("admin/", admin.site.urls),
path("", views.home, name="home"),
path("projects/", include("projects.urls")),
Expand Down
11 changes: 11 additions & 0 deletions app/Entirety/entirety/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import requests

from django.http import HttpResponseRedirect
from django.urls import reverse
from django.shortcuts import render
from django.views.generic import View


class CustomLogin(View):
def get(self, request, **kwargs):
return HttpResponseRedirect(
reverse("oidc_authentication_init")
+ ("?next={}".format(request.GET["next"]) if "next" in request.GET else "")
)


def home(request):
Expand Down

0 comments on commit 49f88e7

Please sign in to comment.