-
Notifications
You must be signed in to change notification settings - Fork 1
Rework email confirmations #44
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
Draft
merwok
wants to merge
20
commits into
main
Choose a base branch
from
feature/rework-email-tokens
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
526fd6a
make email confirmation fully optional #38
merwok e8864b6
improve confirmation email link generation #38
merwok 272cabb
demo: update dependencies
merwok eb4ba79
add skeleton for email confirmation endpoint
merwok 856c9f3
merge develop
merwok 0bf0fb5
add api view to confirm emails #38
merwok 33c0863
merge develop
merwok 03456b6
back to dev
merwok a509661
Merge pull request #69 from caravancoop/post-release-merge
merwok d79f967
merge develop
merwok 8bf70b3
update jinja2 from 2.10 to 2.10.1 (#76)
dependabot[bot] 51ab26f
update dependencies (#82)
merwok 2207f82
update pip-tools from 3.6.0 to 3.6.1 (#83)
dependabot[bot] f612dc7
update djangorestframework from 3.9.2 to 3.9.4 (#86)
dependabot-preview[bot] b37d04f
update django from 2.1.8 to 2.1.9 (#88)
dependabot[bot] 524b1dc
updqte django from 2.1.9 to 2.1.10 (#94)
dependabot-preview[bot] 339376e
update django from 2.1.10 to 2.1.11 (#101)
dependabot-preview[bot] 39accbd
merge master
merwok d5f89a3
merge develop
merwok f783cfa
merge main branch
merwok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
demo/demo/accounts/templates/rest_auth_toolkit/email_confirmation.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% load i18n demotags %} | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body style="background-color: #F7F8FA;"> | ||
<div> | ||
|
||
<p> | ||
{% trans "Follow this link to validate your email:" %}<br> | ||
{% url "pages:confirm-email" token=confirmation.external_id as confirmation_url %} | ||
{% frontend_base_url as base_url %} | ||
<a href="{{ base_url }}{{ confirmation_url }}">{{ base_url }}{{ confirmation_url }}</a> | ||
</p> | ||
|
||
<p> | ||
{% trans "Or send an API request to simulate a front-end application:" %}<br> | ||
<code>HTTP POST {{ base_url }}{% url "auth:confirm" %} email="{{ user.email }}" token="{{ confirmation.external_id }}"</code> | ||
</p> | ||
|
||
</div> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
demo/demo/accounts/templates/rest_auth_toolkit/email_confirmation.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% autoescape off %} | ||
{% load i18n demotags %} | ||
|
||
{% trans "Follow this link to validate your email:" %} | ||
{% frontend_base_url as base_url %} | ||
{{ base_url }}{% url "pages:confirm-email" token=confirmation.external_id %} | ||
|
||
{% trans "Or send an API request to simulate a front-end application:" %} | ||
HTTP POST {{ base_url }}{% url "auth:confirm" %} email="{{ user.email }}" token="{{ confirmation.external_id }}" | ||
|
||
{% endautoescape %} |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django import template | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag(takes_context=True) | ||
def frontend_base_url(context): | ||
request = context['request'] | ||
return request.build_absolute_uri('/')[:-1] |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% load i18n %} | ||
{% get_current_language as LANGUAGE_CODE %} | ||
<!doctype html> | ||
<html lang="{{ LANGUAGE_CODE }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>{% block title %}{% endblock %}</title> | ||
</head> | ||
<body> | ||
{% block body %}{% endblock %} | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,10 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% get_current_language as LANGUAGE_CODE %} | ||
<!doctype html> | ||
<html lang="{{ LANGUAGE_CODE }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>{{ site_name }}</title> | ||
</head> | ||
<body> | ||
{% block title %}Error! {{ site_name }}{% endblock %} | ||
|
||
{% block body %} | ||
<div> | ||
<h1>{% trans "Error!" %}</h1> | ||
<p>{{ error }}</p> | ||
</div> | ||
|
||
</body> | ||
</html> | ||
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% block title %}Success! {{ site_name }}{% endblock %} | ||
|
||
{% block body %} | ||
<div> | ||
<h1>{% trans "Success!" %}</h1> | ||
<p>Your address {{ email }} is now confirmed.</p> | ||
</div> | ||
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
rest_auth_toolkit/templates/rest_auth_toolkit/email_confirmation.html
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
rest_auth_toolkit/templates/rest_auth_toolkit/email_confirmation.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
address this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check for expired confirmation, but it shouldn't be an error related to a duplicate email, tho? A user shouldn't be able to create an account with an email related to another email, tho ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that’s the problem with saving the User/Account before confirmation :(
After #19 and #30 this will be cleaner, but here I’m looking for something simpler but correct for the 0.10 version.