Separate the email configuration into a new file
This commit is contained in:
parent
aebfc08edf
commit
fc4839c682
11
config/email.py
Normal file
11
config/email.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
smtpconfig = {
|
||||||
|
"login" : {
|
||||||
|
"email" : "user@domain.com",
|
||||||
|
"password" : "your_password"
|
||||||
|
},
|
||||||
|
"server" : {
|
||||||
|
"host" : "smtp.domain.com",
|
||||||
|
"port" : 587
|
||||||
|
},
|
||||||
|
"from" : "user@domain.com"
|
||||||
|
}
|
@ -22,18 +22,6 @@ reCAPTCHA = {
|
|||||||
"server" : "your_key"
|
"server" : "your_key"
|
||||||
}
|
}
|
||||||
|
|
||||||
smtpconfig = {
|
|
||||||
"login" : {
|
|
||||||
"email" : "user@domain.com",
|
|
||||||
"password" : "your_password"
|
|
||||||
},
|
|
||||||
"server" : {
|
|
||||||
"host" : "smtp.domain.com",
|
|
||||||
"port" : 587
|
|
||||||
},
|
|
||||||
"from" : "user@domain.com"
|
|
||||||
}
|
|
||||||
|
|
||||||
verification_link_expiration = datetime.datetime.now() + datetime.timedelta(minutes=30)
|
verification_link_expiration = datetime.datetime.now() + datetime.timedelta(minutes=30)
|
||||||
forgot_link_expiration = datetime.datetime.now() + datetime.timedelta(minutes=30)
|
forgot_link_expiration = datetime.datetime.now() + datetime.timedelta(minutes=30)
|
||||||
# Can be hours or minutes
|
# Can be hours or minutes
|
||||||
|
@ -2,7 +2,7 @@ import mysql.connector as mariadb
|
|||||||
from mako.template import Template
|
from mako.template import Template
|
||||||
from bottle import request, response as bottle_response
|
from bottle import request, response as bottle_response
|
||||||
|
|
||||||
from config import database, globalvar
|
from config import database, email, globalvar
|
||||||
|
|
||||||
import bcrypt
|
import bcrypt
|
||||||
import datetime
|
import datetime
|
||||||
@ -17,7 +17,7 @@ class auth:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.db_main = mariadb.connect(**database.db_main)
|
self.db_main = mariadb.connect(**database.db_main)
|
||||||
self.cursor = self.db_main.cursor(dictionary=True)
|
self.cursor = self.db_main.cursor(dictionary=True)
|
||||||
self.smtpconfig = globalvar.smtpconfig
|
self.smtpconfig = email.smtpconfig
|
||||||
|
|
||||||
def register(self, params):
|
def register(self, params):
|
||||||
APIADDR = "/api/auth/register/:roles"
|
APIADDR = "/api/auth/register/:roles"
|
||||||
|
Loading…
Reference in New Issue
Block a user