RTippin / messenger

Laravel messenger. A full messenger suite for your new / existing laravel app! Private and group threads between multiple models, with real-time messaging, reactions, attachments, calling, chat bots, and more!
https://tippindev.com
MIT License
416 stars 84 forks source link

Not authorized to view thread. #58

Closed isalman-developer closed 1 year ago

isalman-developer commented 1 year ago

through postman i created the group then authenticated the user when i try to load the messages it returns the error "Not authorized to view thread."

isalman-developer commented 1 year ago

created a group with two users { "providers": [ { "alias": "user", "id": "2" }, { "alias": "user", "id": "3" } ], "subject": "testing_group" }

and i got the response with payload { "id": "98bd12e9-7e0b-4047-af28-d0bbe4139aef", "type": 2, "type_verbose": "GROUP", "has_call": false, "locked": false, "pending": false, "name": "lms", "avatar": { "sm": "/messenger/assets/threads/98bd12e9-7e0b-4047-af28-d0bbe4139aef/avatar/sm/default.png", "md": "/messenger/assets/threads/98bd12e9-7e0b-4047-af28-d0bbe4139aef/avatar/md/default.png", "lg": "/messenger/assets/threads/98bd12e9-7e0b-4047-af28-d0bbe4139aef/avatar/lg/default.png" }, "group": true, "unread": true, "unread_count": 1, "created_at": "2023-03-21T05:58:55.335992Z", "updated_at": "2023-03-21T05:58:55.335992Z", "options": { "admin": true, "manage_bots": false, "chat_bots": false, "muted": false, "add_participants": true, "invitations": true, "call": false, "message": true, "knock": true }, "system_features": { "bots": false, "calling": false, "invitations": true, "invitations_max": 3, "knocks": true, "audio_messages": true, "document_messages": true, "image_messages": true, "message_edits": true, "message_edits_view": true, "message_reactions": true, "message_reactions_max": 10, "provider_avatars": true, "thread_avatars": true, "bot_avatars": true }, "resources": { "latest_message": { "id": "98bd12e9-83fd-4d7d-9ee0-f585ff5c30ee", "thread_id": "98bd12e9-7e0b-4047-af28-d0bbe4139aef", "owner_id": 3, "ownertype": "App\Models\User", "owner": { "name": "John Customer", "route": null, "provider_id": 3, "provideralias": "user", "base": { "id": 3, "name": "John customer", "email": "customer@gmail.com", "username": "customer123", "gender": "Female", "mobile_number": "+921234567", "description": "null", "image": "userImages/47SLYslJSJpAVXojCNoW7WAjtoSSlcKgM6uHMT3N.jpg", "email_verified_at": null, "otp": null, "status": 1, "deleted_at": null, "created_at": "2023-03-07T06:35:25.000000Z", "updated_at": "2023-03-10T09:10:45.000000Z" }, "avatar": { "sm": "/messenger/assets/provider/user/3/sm/default.png", "md": "/messenger/assets/provider/user/3/md/default.png", "lg": "/messenger/assets/provider/user/3/lg/default.png" } }, "type": 93, "type_verbose": "GROUP_CREATED", "system_message": true, "from_bot": false, "body": "created lms", "edited": false, "reacted": false, "embeds": false, "extra": null, "created_at": "2023-03-21T05:58:55.344952Z", "updated_at": "2023-03-21T05:58:55.344952Z", "meta": { "thread_id": "98bd12e9-7e0b-4047-af28-d0bbe4139aef", "thread_type": 2, "thread_type_verbose": "GROUP", "thread_name": "lms", "thread_avatar": { "sm": "/messenger/assets/threads/98bd12e9-7e0b-4047-af28-d0bbe4139aef/avatar/sm/default.png", "md": "/messenger/assets/threads/98bd12e9-7e0b-4047-af28-d0bbe4139aef/avatar/md/default.png", "lg": "/messenger/assets/threads/98bd12e9-7e0b-4047-af28-d0bbe4139aef/avatar/lg/default.png" } } } } }

isalman-developer commented 1 year ago

but when i try to load the chat with api api/messenger/threads/98bd12e9-7e0b-4047-af28-d0bbe4139aef/load

i got the error { "message": "Not authorized to view thread." }

RTippin commented 1 year ago

In the initial post to create the group you shared, you named it testing_group yet the API response you shared has the group named as lms. Please check that you are authenticated as the proper user for the group in question.