...
 
Commits (4)
......@@ -59,3 +59,9 @@ dictionary named ```login.html```. Minimum required content:
<button type="submit">Sign In</button>
</form>
```
## CHANGELOG:
| version | date | changes |
| ------- | -----------| ------ |
| 0.0.12 | 2019-03-05 | - NEW FEATURE: input field to set cookie and remember ID |
| 0.0.11 | 2019-02-27 | - BUGFIX: Client registration updated when re-registered |
......@@ -7,6 +7,11 @@ class LoginForm(forms.Form):
label=('ID4me'),
help_text=(
'Get an <a href="https://id4me.org/">ID4me</a>'))
rememberme = forms.BooleanField(
label=('Remember ID'),
initial=False,
required=False,
)
next = forms.CharField(
widget=forms.HiddenInput,
required=False)
......
......@@ -25,7 +25,8 @@ def login(request):
if form.is_valid():
provider = ID4meProvider(request)
try:
ctx = provider.get_rp_context(form.cleaned_data['id4me'])
id4me = form.cleaned_data['id4me']
ctx = provider.get_rp_context(id4me)
safesession = JSONSafeSession(request.session)
SocialLogin.stash_state(request)
url = provider.get_consent_url(ctx)
......@@ -34,7 +35,10 @@ def login(request):
# if 'next' in form.cleaned_data and form.cleaned_data['next']:
# auth_request.return_to_args['next'] = \
# form.cleaned_data['next']
return HttpResponseRedirect(url)
resp = HttpResponseRedirect(url)
if (form.cleaned_data['rememberme']):
resp.set_cookie('id4me.user', id4me)
return resp
# UnicodeDecodeError:
# see https://github.com/necaris/python3-openid/issues/1
except (ID4meException) as e:
......
......@@ -3,7 +3,7 @@
from setuptools import setup
setup(name='django-allauth-id4me',
version='0.0.11',
version='0.0.12',
description='Social provider for django-allauth - ID4me https://id4me.org',
long_description_content_type="text/markdown",
long_description=open('README.md').read(),
......