misc: inherit from authentic2_auh_saml AppConfig (#69739)
This commit is contained in:
parent
4e60a12378
commit
eb8ba992d0
|
@ -15,4 +15,3 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
default_app_config = '%s.apps.AppConfig' % __name__
|
||||
|
||||
|
|
|
@ -16,15 +16,17 @@
|
|||
|
||||
import json
|
||||
|
||||
import django.apps
|
||||
from authentic2_auth_saml.apps import AppConfig
|
||||
from django.contrib.auth.signals import user_logged_in
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
class AppConfig(django.apps.AppConfig):
|
||||
class AppConfig(AppConfig):
|
||||
name = 'authentic2_auth_fedict'
|
||||
|
||||
def ready(self):
|
||||
super().ready()
|
||||
|
||||
from . import signals
|
||||
|
||||
user_logged_in.connect(signals.on_user_logged_in)
|
||||
|
@ -48,15 +50,6 @@ class Plugin:
|
|||
def get_authentication_backends(self):
|
||||
return ['authentic2_auth_fedict.backends.FedictBackend']
|
||||
|
||||
def redirect_logout_list(self, request, next_url=None):
|
||||
from mellon.views import logout
|
||||
|
||||
if 'mellon_session' in request.session:
|
||||
response = logout(request)
|
||||
if 'Location' in response:
|
||||
return [response['Location']]
|
||||
return []
|
||||
|
||||
def registration_form_prefill(self, request):
|
||||
if request.token.get('first_name'):
|
||||
return [
|
||||
|
|
|
@ -19,7 +19,7 @@ from django.conf.urls import include, url
|
|||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^accounts/saml/', include('mellon.urls')),
|
||||
url(r'^accounts/saml/', include('mellon.urls'), kwargs={'logout_next_url': '/logout/'}),
|
||||
url(
|
||||
r'^accounts/fedict/login/$',
|
||||
views.login,
|
||||
|
|
Loading…
Reference in New Issue