You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is a newbie question, i create on joomla specific user a.k.a (usrRequests) and add token in component on backend.
and this is the user story
-> user "test" login on joomla
-> then go to a menu item and show´s K2 component item
-> make a ajax request to the api, (using token from the usrRequests)
--> i set in /plugins/api/categories/categories.php $this->setResourceAccess('company', '', 'post');
and in the ajax request jQuery.ajax({ url: '/index.php?option=com_api&app=categories&resource=company&format=raw&mode=2&key=XXXXXXXXXXX', dataType: 'json', method: 'POST', cache: false, data: { info: formdata, time: jQuery.now() }, success: function (data, textStatus, jqXHR) { }, beforeSend: function (xhr) { }, error: function (jqXHR, textStatus, errorThrown) { console.log('An error occured!'); } });
every things and response it´s ok.. and all works fine -> but it change the session from the user "test" to the user "usrRequests"
The question is
i need one token per user to make ajax requests?
is it possible to use a generic token or a single user token to make requests independent of the user who is authenticated in joomla?
The text was updated successfully, but these errors were encountered:
Good Day,,
this is a newbie question, i create on joomla specific user a.k.a (usrRequests) and add token in component on backend.
and this is the user story
-> user "test" login on joomla
-> then go to a menu item and show´s K2 component item
-> make a ajax request to the api, (using token from the usrRequests)
--> i set in /plugins/api/categories/categories.php
$this->setResourceAccess('company', '', 'post');
and in the ajax request
jQuery.ajax({ url: '/index.php?option=com_api&app=categories&resource=company&format=raw&mode=2&key=XXXXXXXXXXX', dataType: 'json', method: 'POST', cache: false, data: { info: formdata, time: jQuery.now() }, success: function (data, textStatus, jqXHR) { }, beforeSend: function (xhr) { }, error: function (jqXHR, textStatus, errorThrown) { console.log('An error occured!'); } });
every things and response it´s ok.. and all works fine
-> but it change the session from the user "test" to the user "usrRequests"
The question is
The text was updated successfully, but these errors were encountered: