Compare commits

...

3 Commits

2 changed files with 11 additions and 2 deletions

View File

@ -24,7 +24,7 @@ reCAPTCHA = {
verification_link_expiration = datetime.datetime.now() + datetime.timedelta(minutes=30)
forgot_link_expiration = datetime.datetime.now() + datetime.timedelta(minutes=30)
# Can be hours or minutes
invitation_link_expiration = datetime.datetime.now() + datetime.timedelta(hours=48)
baseurl = "https://domain.com"
if production == False:
@ -46,3 +46,11 @@ def change_forgot_url(token):
url = f"{baseurl}/reset?token={token}"
return url
def invitation_url(token):
url = f"{baseurl}/accept?token={token}"
return url
allowed_invitation = [
{ roles: 1, allowed: [1,2] },
{ roles: 2, allowed: [2] },
]

View File

@ -54,9 +54,10 @@ class auth:
auth_profile_lastrowid = self.cursor.lastrowid
self.cursor.execute("INSERT INTO `auth_profile_verification` VALUES (DEFAULT, %s, 'email', 0);", (auth_profile_lastrowid,) )
self.cursor.execute("INSERT INTO `auth_profile_roles` VALUES (DEFAULT, %s, %s);", (auth_profile_lastrowid, result_roles['id']) )
loggorilla.prcss(APIADDR, "Generate URL")
loggorilla.prcss(APIADDR, "Set expired datetime")
expired = globalvar.verification_link_expiration
expired_isoformat = expired.isoformat()
loggorilla.prcss(APIADDR, "Generate URL")
payload = {
"token" : token,
"expired": expired_isoformat