fix issue with WordPress login
- resolving role name
This commit is contained in:
parent
5206c78998
commit
97d4f0845d
2 changed files with 13 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ from helpers import KratosUser
|
|||
from config import *
|
||||
from web import web
|
||||
from areas.apps import AppRole, App
|
||||
from areas.roles import RoleService
|
||||
|
||||
|
||||
# This is a circular import and should be solved differently
|
||||
|
|
@ -261,7 +262,9 @@ def consent():
|
|||
.filter(AppRole.user_id == user.uuid)
|
||||
)
|
||||
for role_obj in role_objects:
|
||||
roles.append(role_obj.role.name)
|
||||
role_name = RoleService.get_role_by_id(role_obj.role_id).name
|
||||
if (role_name is not None):
|
||||
roles.append(role_name)
|
||||
|
||||
current_app.logger.info(f"Using '{roles}' when applying consent for {kratos_id}")
|
||||
|
||||
|
|
|
|||
Reference in a new issue