Skip to content

Commit 40e91a1

Browse files
committed
fix: chat user
1 parent bf1942e commit 40e91a1

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

apps/chat/serializers/chat_authentication.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def profile(self):
7070
'icon': application_setting.application.icon,
7171
'application_name': application_setting.application.name,
7272
'bg_icon': application_setting.chat_background,
73-
'authentication': application_setting.authentication,
74-
'authentication_type': application_setting.authentication_value.get(
73+
'authentication': application_access_token.authentication,
74+
'authentication_type': application_access_token.authentication_value.get(
7575
'type', 'password'),
76-
'login_value': application_setting.authentication_value.get('login_value', [])
76+
'login_value': application_access_token.authentication_value.get('login_value', [])
7777
}
7878
return profile
7979

apps/common/auth/handle/impl/chat_anonymous_user_token.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ def handle(self, request, token: str, get_token_details):
4141
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
4242
if not application_access_token.access_token == access_token:
4343
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
44-
application_setting_model = DatabaseModelManage.get_model("application_setting")
45-
if application_setting_model is not None:
46-
application_setting = QuerySet(application_setting_model).filter(application_id=application_id).first()
47-
if application_setting.authentication:
48-
if chat_user_token.authentication.auth_type != application_setting.authentication_value.get('type', ''):
49-
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
44+
if application_access_token.authentication:
45+
if chat_user_token.authentication.auth_type != application_access_token.authentication_value.get('type',
46+
''):
47+
raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
5048
return None, ChatAuth(
5149
current_role_list=[RoleConstants.CHAT_ANONYMOUS_USER],
5250
permission_list=[

0 commit comments

Comments
 (0)