fix: [debug]

This commit is contained in:
terrtia 2024-08-12 13:58:24 +02:00
parent 8e819f85cd
commit b844c34715
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 3 additions and 6 deletions

View file

@ -448,7 +448,6 @@ class AILUser(UserMixin):
def rotate_session(self): def rotate_session(self):
self.id = _rotate_user_session(self.user_id) self.id = _rotate_user_session(self.user_id)
print('rotate session:', self.id)
return self.id return self.id
def kill_session(self): def kill_session(self):
@ -527,9 +526,7 @@ class AILUser(UserMixin):
## ROLE ## ## ROLE ##
def is_in_role(self, role): # TODO Get role via user alternative ID def is_in_role(self, role):
print('is_in_role')
print(f'ail:users:role:{role}', self.user_id)
if r_serv_db.sismember(f'ail:users:role:{role}', self.user_id): if r_serv_db.sismember(f'ail:users:role:{role}', self.user_id):
return True return True
else: else:

View file

@ -22,7 +22,7 @@ sys.path.append(os.environ['AIL_BIN'])
################################## ##################################
# Import Project packages # Import Project packages
################################## ##################################
from lib import Users from lib import Users # TODO ########################################################3
from lib.ail_users import AILUser, kill_sessions from lib.ail_users import AILUser, kill_sessions
from lib.ConfigLoader import ConfigLoader from lib.ConfigLoader import ConfigLoader
@ -136,7 +136,7 @@ def login():
if current_user.is_authenticated: if current_user.is_authenticated:
return redirect(url_for('dashboard.index')) return redirect(url_for('dashboard.index'))
else: else:
print(current_user) # print(current_user)
next_page = request.args.get('next') next_page = request.args.get('next')
error = request.args.get('error') error = request.args.get('error')
return render_template("login.html", next_page=next_page, error=error) return render_template("login.html", next_page=next_page, error=error)