Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dj rest auth #548

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/readit/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
This contains some custom serializers to customize, for example, the user details django rest-auth returns after a successful login.
See https://django-rest-auth.readthedocs.io/en/latest/configuration.html for more details on the options.
This contains some custom serializers to customize, for example, the user details dj-rest-auth returns after a successful login.
See https://dj-rest-auth.readthedocs.io/en/latest/configuration.html for more details on the options.
'''

from django.contrib.auth.models import User, Permission
Expand Down
4 changes: 2 additions & 2 deletions backend/readit/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'rest_auth',
'dj_rest_auth',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'rest_auth.registration',
'dj_rest_auth.registration',
'rdflib_django',
'corsheaders',
'rdf',
Expand Down
2 changes: 1 addition & 1 deletion backend/readit/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'rest_framework.urls',
namespace='rest_framework',
)),
path('rest-auth/', include('rest_auth.urls')),
path('rest-auth/', include('dj_rest_auth.urls')),
path('rest-auth/registration/', include('register.urls')),
re_path(r'proxy/(?P<url>.*)', decode_and_proxy),
path(VOCAB_ROUTE, include('vocab.urls')),
Expand Down
4 changes: 2 additions & 2 deletions backend/register/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"""
from django.urls import path, re_path, include
from django.views.generic import TemplateView
from rest_auth.registration.views import VerifyEmailView, RegisterView
from dj_rest_auth.registration.views import VerifyEmailView, RegisterView
from allauth.account.views import confirm_email
from .views import null_view

urlpatterns = [
re_path(r'^account-email-verification-sent/', null_view, name='account_email_verification_sent'),
re_path(r'^account-confirm-email/', null_view, name='account_confirm_email'),
path('', include('rest_auth.registration.urls')),
path('', include('dj_rest_auth.registration.urls')),
]
6 changes: 3 additions & 3 deletions backend/requirements.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
celery
django>=3.2,<4
djangorestframework
django-rest-auth[with_social]
defusedxml<0.6.0
dj-rest-auth[with_social]
django-cors-headers
django-livereload-server
django-proxy
django-cors-headers
djangorestframework
elasticsearch
rdflib>6
rdflib-django3
Expand Down
27 changes: 17 additions & 10 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ certifi==2019.6.16
# via
# elasticsearch
# requests
cffi==1.15.1
# via cryptography
charset-normalizer==2.0.12
# via requests
click==8.1.3
Expand All @@ -38,33 +40,35 @@ click-plugins==1.1.1
# via celery
click-repl==0.2.0
# via celery
cryptography==37.0.4
# via pyjwt
defusedxml==0.5.0
# via
# -r requirements.in
# python3-openid
dj-rest-auth[with_social]==2.2.5
# via -r requirements.in
django==3.2.14
# via
# -r requirements.in
# dj-rest-auth
# django-allauth
# django-cors-headers
# django-livereload-server
# django-rest-auth
# djangorestframework
# rdflib-django3
django-allauth==0.41.0
# via django-rest-auth
django-allauth==0.50.0
# via dj-rest-auth
django-cors-headers==3.11.0
# via -r requirements.in
django-livereload-server==0.4
# via -r requirements.in
django-proxy==1.2.1
# via -r requirements.in
django-rest-auth[with_social]==0.9.5
# via -r requirements.in
djangorestframework==3.13.1
# via
# -r requirements.in
# django-rest-auth
# dj-rest-auth
elasticsearch==7.17.4
# via -r requirements.in
execnet==1.7.1
Expand All @@ -77,7 +81,7 @@ isodate==0.6.0
# via rdflib
kombu==5.2.4
# via celery
oauthlib==3.1.0
oauthlib==3.2.0
# via requests-oauthlib
packaging==19.1
# via pytest
Expand All @@ -89,6 +93,10 @@ psycopg2==2.8.4
# via -r requirements.in
py==1.11.0
# via pytest
pycparser==2.21
# via cffi
pyjwt[crypto]==2.4.0
# via django-allauth
pyparsing==2.4.2
# via
# packaging
Expand All @@ -105,7 +113,7 @@ pytest-forked==1.0.2
# via pytest-xdist
pytest-xdist==1.29.0
# via -r requirements.in
python3-openid==3.1.0
python3-openid==3.2.0
# via django-allauth
pytz==2019.2
# via
Expand All @@ -124,13 +132,12 @@ requests==2.28.0
# django-allauth
# django-proxy
# requests-oauthlib
requests-oauthlib==1.3.0
requests-oauthlib==1.3.1
# via django-allauth
six==1.12.0
# via
# click-repl
# django-livereload-server
# django-rest-auth
# isodate
# packaging
# pytest-xdist
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/registration/registration-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ export default class RegistrationFormView extends View {

render(): this {
this.$el.html(this.template(this));
this.$('form').validate({
this.$("form").validate({
errorClass: "help is-danger",
rules: {
email: {
required: true,
email: true
email: true,
},
password1: "required",
password2: {
equalTo: "#password",
},
password: "required",
password_again: {
equalTo: "#password"
}
},
});
return this;
Expand Down