diff --git a/modules/api/auth.py b/modules/api/auth.py index 712e1b2..fe2cfa9 100644 --- a/modules/api/auth.py +++ b/modules/api/auth.py @@ -254,6 +254,9 @@ class auth: 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, jwt) + user = user_validation['data'] loggorilla.prcss(APIADDR, "Get dependency data") self.cursor.execute("SELECT COUNT(*) AS `count`, auth.token, auth_profile.id, auth_profile.username, auth.password FROM auth_profile INNER JOIN auth ON auth.token = auth_profile.token WHERE auth_profile.username = %s ; ", (user['profile']['username'],) ) result_login = self.cursor.fetchone() @@ -261,9 +264,6 @@ class auth: result_email = self.cursor.fetchone() self.cursor.execute("SELECT COUNT(*) AS `count` FROM auth_profile WHERE username = %s ; ", (username,) ) result_username = self.cursor.fetchone() - loggorilla.prcss(APIADDR, "Account validation") - user_validation = procedure_validation.validation().account(APIADDR, allowed_roles, token) - user = user_validation['data'] loggorilla.prcss(APIADDR, "Validating") if not procedure_grant.is_grant_allowed(user['profile']['roles'], roles, allowed_grant): loggorilla.accss(APIADDR, f"{user['profile']['username']} do invitation with unallowed role(s)")