Compare commits

..

No commits in common. "b9d0f28a7660a346fb9439fdccb94278d8cee31e" and "3e85e6375f8cb57bced21ced6646faf9b32abdc0" have entirely different histories.

3 changed files with 0 additions and 52 deletions

View File

@ -236,37 +236,6 @@ class auth:
self.db_main.close()
return response
def invite(self, params):
APIADDR = "/api/auth/invite"
response = {}
allowed_roles = [1,2]
allowed_invitation = globalvar.allowed_invitation
self.cursor.execute("BEGIN;")
try:
loggorilla.prcss(APIADDR, "Define parameters")
roles = params["roles" ]
email = params["email" ]
username = params["username" ]
password = params["password" ] # Admin should insert their password for send invitation confirmation
loggorilla.prcss(APIADDR, "Extract the Authorization token from Header")
auth_header = request.get_header('Authorization')
jwt = auth_header.split(' ')[1]
payload = tokenguard.decode(jwt, globalvar.ssh['key']['public'])
session_id = payload["session"]["id"]
loggorilla.prcss(APIADDR, "Account validation")
user_validation = procedure_validation.validation().account(APIADDR, allowed_roles, token)
user = user_validation['data']
except Exception as e:
self.cursor.execute("ROLLBACK;")
loggorilla.error(APIADDR, str(e) )
response["status" ] = "failed"
response["desc" ] = "Internal Server Error. Please contact us if you still have an error."
finally:
self.cursor.execute("COMMIT;")
self.cursor.close()
self.db_main.close()
return response
def login(self, params):
APIADDR = "/api/auth/login"
response = {}

View File

@ -1,6 +0,0 @@
<h2>Accept Invitation</h2>
<p>Please visit this link below to accept the invitation.</p>
<a href="${accept}" class="button">
Accept
</a>

View File

@ -77,18 +77,3 @@ class webmail():
)
)
}
def invitation(self, APIADDR, params, data):
return {
"subject" : f"{globalvar.title} invitation",
"text" : f"Please visit this link to accept the invitation: {data['accept']}",
"html" : Template(params["mako"]["email"]['index']).render(
title = globalvar.title,
header = globalvar.title,
copyright = globalvar.copyright,
container = Template(params["mako"]["email"]['container']).render(
header = "One more step to complete your invitation!",
accept = data['accept' ]
)
)
}