working-on

This commit is contained in:
2022-08-11 12:09:57 +03:00
parent 8aec6c6e07
commit 83f5f280b2
30 changed files with 229 additions and 86 deletions

View File

@@ -10,7 +10,7 @@ from auth.jwtcodec import JWTCodec
from auth.authorize import Authorize, TokenStorage
from base.exceptions import InvalidToken
from orm.user import User
from storages.users import UserStorage
from services.auth.users import UserStorage
from base.orm import local_session
from settings import JWT_AUTH_HEADER, EMAIL_TOKEN_LIFE_SPAN

View File

@@ -6,7 +6,7 @@ from settings import BACKEND_URL, MAILGUN_API_KEY, MAILGUN_DOMAIN, RESET_PWD_URL
CONFIRM_EMAIL_URL, ERROR_URL_ON_FRONTEND
MAILGUN_API_URL = "https://api.mailgun.net/v3/%s/messages" % (MAILGUN_DOMAIN)
MAILGUN_FROM = "postmaster <postmaster@%s>" % (MAILGUN_DOMAIN)
MAILGUN_FROM = "discours.io <noreply@%s>" % (MAILGUN_DOMAIN)
AUTH_URL = "%s/email_authorize" % (BACKEND_URL)
@@ -14,7 +14,7 @@ email_templates = {"confirm_email" : "", "auth_email" : "", "reset_password_emai
def load_email_templates():
for name in email_templates:
filename = "templates/%s.tmpl" % name
filename = "auth/templates/%s.tmpl" % name # TODO: check path
with open(filename) as f:
email_templates[name] = f.read()
print("[auth.email] templates loaded")

View File

@@ -0,0 +1 @@
<html><body>To enter the site follow the <a href='%s'>link</link></body></html>

View File

@@ -0,0 +1 @@
<html><body>To confirm registration follow the <a href='%s'>link</link></body></html>

View File

@@ -0,0 +1 @@
<html><body>To reset password follow the <a href='%s'>link</link></body></html>