Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missed authenticated user session #61

Open
carlos-andres opened this issue Sep 26, 2017 · 0 comments
Open

missed authenticated user session #61

carlos-andres opened this issue Sep 26, 2017 · 0 comments

Comments

@carlos-andres
Copy link

carlos-andres commented Sep 26, 2017

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

  1. i need one token per user to make ajax requests?
  2. 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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant