OK, after trying those commands on ID#16 and ID#18, both the tokens look fine when printed with the same commands as yesterday:
#<Token:0x00007f07...
id: 16,
user_id: 4,
persistent: true,
token: "[REDACTED]",
action: "api",
name: "[REDACTED]",
preferences: {"permission"=>["cti.agent", "ticket.agent"]}, <-- looks fixed
last_used_at: Mon, 11 Jul 2022 09:22:46.916000000 UTC +00:00,
expires_at: Sun, 31 Jul 2022,
created_at: Fri, 08 Jul 2022 21:01:32.958000000 UTC +00:00,
updated_at: Wed, 07 Feb 2024 13:39:45.528000000 UTC +00:00>,
#<Token:0x00007f0...
id: 18,
user_id: 4,
persistent: true,
token: "[REDACTED]",
action: "api",
name: "[REDACTED]",
preferences: {"permission"=>["cti.agent", "ticket.agent"]}, <-- looks fixed
last_used_at: Fri, 08 Jul 2022 21:29:55.314000000 UTC +00:00,
expires_at: Sun, 10 Jul 2022,
created_at: Fri, 08 Jul 2022 21:28:49.815000000 UTC +00:00,
updated_at: Wed, 07 Feb 2024 13:58:26.463000000 UTC +00:00>,
Unfortunately I’m still seeing the same error on the frontend and the token page is still blank for both user_id 3 and user_id 4.
As for your suggestion I have downloaded the list at the address “api/v1/user_access_token”. I do not see anything strange in the preferences of the tokens.
User_id 3
"tokens": [
{
"id": 20,
"user_id": 3,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": [
"admin.user",
"ticket.agent",
"ticket.customer"
]
},
"last_used_at": "2024-02-06T09:55:40.420Z",
"expires_at": "2030-12-31",
"created_at": "2022-07-10T10:56:01.482Z",
"updated_at": "2024-02-06T09:55:40.420Z"
},
{
"id": 26,
"user_id": 3,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": "ticket.agent"
},
"last_used_at": "2024-02-03T20:58:08.584Z",
"expires_at": "2024-12-31",
"created_at": "2024-02-03T18:58:15.197Z",
"updated_at": "2024-02-03T20:58:08.584Z"
},
{
"id": 25,
"user_id": 3,
"action": "api",
"name": "Postman",
"preferences": {
"permission": [
"admin",
"user_preferences"
]
},
"last_used_at": "2024-02-03T18:58:15.156Z",
"expires_at": "2024-02-04",
"created_at": "2024-02-03T18:55:07.352Z",
"updated_at": "2024-02-03T18:58:15.156Z"
}
],
User_id 4
"tokens": [
{
"id": 16,
"user_id": 4,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": [
"cti.agent",
"ticket.agent"
]
},
"last_used_at": "2022-07-11T09:22:46.916Z",
"expires_at": "2022-07-31",
"created_at": "2022-07-08T21:01:32.958Z",
"updated_at": "2024-02-07T13:39:45.528Z"
},
{
"id": 15,
"user_id": 4,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": [
"ticket.agent",
"user_preferences.access_token"
]
},
"last_used_at": "2024-02-03T18:00:42.043Z",
"expires_at": "2022-07-31",
"created_at": "2022-07-08T20:50:19.612Z",
"updated_at": "2024-02-03T18:00:42.043Z"
},
{
"id": 19,
"user_id": 4,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": "ticket.agent"
},
"last_used_at": "2022-07-08T22:45:55.994Z",
"expires_at": "2022-07-31",
"created_at": "2022-07-08T21:35:08.223Z",
"updated_at": "2022-07-08T22:45:55.995Z"
},
{
"id": 18,
"user_id": 4,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": "[cti.agent,ticket.agent]"
},
"last_used_at": "2022-07-08T21:29:55.314Z",
"expires_at": "2022-07-10",
"created_at": "2022-07-08T21:28:49.815Z",
"updated_at": "2022-07-08T21:29:55.314Z"
},
{
"id": 17,
"user_id": 4,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": "cti.agent,ticket.agent" <-- looks like it's missing the square brackets
},
"last_used_at": null,
"expires_at": "2022-07-09",
"created_at": "2022-07-08T21:25:28.847Z",
"updated_at": "2022-07-08T21:25:28.847Z"
},
{
"id": 8,
"user_id": 4,
"action": "api",
"name": "[REDACTED]",
"preferences": {
"permission": [
"ticket.agent",
"user_preferences.notifications"
]
},
"last_used_at": "2020-12-31T00:42:30.699Z",
"expires_at": "2021-12-31",
"created_at": "2020-11-30T23:39:41.667Z",
"updated_at": "2020-12-31T00:42:30.700Z"
}
],
The “tokens” array is followed by another array named “permissions” with a very long list of elements like these:
"permissions": [
{
"id": 1,
"name": "admin",
"note": "Admin Interface",
"preferences": {},
"active": true,
"created_at": "2020-09-28T17:05:15.134Z",
"updated_at": "2020-09-28T17:05:15.134Z",
"allow_signup": false
},
{
"id": 30,
"name": "admin.api",
"note": "Manage %s",
"preferences": {
"translations": [
"API"
]
},
"active": true,
"created_at": "2020-09-28T17:05:15.328Z",
"updated_at": "2020-09-28T17:05:15.328Z",
"allow_signup": false
},
The list is very long, I’m not sure it’s ok to post it here. If useful I can post it on some Pastebin, let me know.
UPDATE
I fixed the token ID#17 andnow it looks ok in the json:
{
"tokens": [
{
"id": 17,
"user_id": 4,
"action": "api",
"name": "Assistenza frigo gasatori test",
"preferences": {
"permission": [
"cti.agent",
"ticket.agent"
]
},
"last_used_at": null,
"expires_at": "2022-07-09",
"created_at": "2022-07-08T21:25:28.847Z",
"updated_at": "2024-02-07T14:37:10.438Z"
},
QUICK FIX (actually not a fix, just a way around the problem)
I’ve created a new user with admin privileges. The new user is able to access the token page in the profile.
Then I created a new token with “admin” and “ticket.agent” permissions. After logout+login the new user can still access the token page in the profile, so as a quick fix I can now reissue all the tickets by this user and use them in the webapp. I’ll let you know if this user loses the access too.
Anyway, I’d like to find out what’s the problem as this sould not be happening. Thanks for your help.