Can you tell me how I can get the account token? I assumed that after authorization I would get the “/api/cockpit/authUser” user token so I could continue, but I only get an array of user data and no token there.
1. active: true
2. email: "admin@yourdomain.de"
3. group: "admin"
4. i18n: "en"
5. name: "Admin"
6. user: "admin"
7. _created: 1646744373
8. _id: "20224ebf3333667c5d0001ad"
9. _modified: 1646744373
Can you tell me how I can get it?
I guess this is similar to this issue. Hope it helps.
opened 05:44AM - 17 Aug 18 UTC
closed 03:47AM - 19 Aug 18 UTC
https://getcockpit.com/documentation/api/cockpit
I read the documentation and … it seems every "fetch" ajax request has to include a token key.
Form my experience with others API CMS, a user send a post request and a token key is returned.
Probably, something like this
```
$.ajax({
type: 'POST',
url: 'http://mydomain.com/api/auth',
data: {
username: 'john@johndoe.com',
password: 'johndoe'
},
success: function(response) {
console.log('User token', response.jwt);
},
error: function(error) {
console.log('Error : ', error);
}
});
```
Do I have to generate a new token key in backend panel manually?
Thanks in advance.