feat: trigger handoff when agent bot is the actor (#8639)

- This PR adds a feature to auto-trigger handoff events when an Agent bot toggles a conversation status from Pending to Open

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Shivam Mishra
2024-01-06 04:56:52 +05:30
committed by GitHub
parent dc4e13b300
commit 56fbbe92b4
4 changed files with 56 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ module AccessTokenAuthHelper
render_unauthorized('Invalid Access Token') && return if @access_token.blank?
@resource = @access_token.owner
Current.user = @resource if current_user.is_a?(User)
Current.user = @resource if [User, AgentBot].include?(@resource.class)
end
def validate_bot_access_token!