#4184 set project_token=False in all views
Closed 5 years ago by pingou. Opened 5 years ago by lenkaseg.
Unknown source check_token  into  master

file modified
+3 -3
@@ -502,7 +502,7 @@

      """

      repo = _get_repo(repo, username, namespace)

      _check_issue_tracker(repo)

-     _check_token(repo)

+     _check_token(repo, project_token=False)

  

      assignee = flask.request.args.get("assignee", None)

      author = flask.request.args.get("author", None)
@@ -679,7 +679,7 @@

  

      repo = _get_repo(repo, username, namespace)

      _check_issue_tracker(repo)

-     _check_token(repo)

+     _check_token(repo, project_token=False)

  

      issue_id = issue_uid = None

      try:
@@ -747,7 +747,7 @@

  

      repo = _get_repo(repo, username, namespace)

      _check_issue_tracker(repo)

-     _check_token(repo)

+     _check_token(repo, project_token=False)

  

      issue_id = issue_uid = None

      try:

I had a problem to access a list of issues via API. The error message was Invalid or expired token.
First: my token was not really expired
Second: why the token should be necessary for issue view.

I set the project_token to False for all the view functions and now it works well for me.

Second: why the token should be necessary for issue view.

It is not necessary but if one is provided it will be checked.
And the token is useful and used as if you have certain access level to the project you will be getting private issues which you will not if you are not authenticated or are but not have sufficient access.

Ok, so the problem is really my wrong token..let's see...

Going to close this one then :)

Pull-Request has been closed by pingou

5 years ago