30 lines
958 B
Python
30 lines
958 B
Python
from django.utils.translation import gettext_noop
|
|
from django.template.loader import render_to_string
|
|
from django.template import RequestContext
|
|
from django.shortcuts import render
|
|
|
|
from . import app_settings
|
|
|
|
class FcFrontend(object):
|
|
def enabled(self):
|
|
return app_settings.enabled
|
|
|
|
def name(self):
|
|
return gettext_noop('France Connect')
|
|
|
|
def id(self):
|
|
return 'fc'
|
|
|
|
def login(self, request, *args, **kwargs):
|
|
if 'nofc' in request.GET:
|
|
return
|
|
context_instance = kwargs.pop('context_instance', None)
|
|
return render(request, 'authentic2_auth_fc/login.html',
|
|
context_instance=context_instance)
|
|
|
|
def profile(self, request, *args, **kwargs):
|
|
context_instance = kwargs.pop('context_instance', None) or RequestContext(request)
|
|
return render_to_string('authentic2_auth_fc/linking.html', {'popup': True},
|
|
context_instance=context_instance)
|
|
|