Problem/Motivation

When an access token has expired and can't be renewed, the NonrenewableTokenException thrown has no message. But the constructor has logic that should create a message if one hasn't been passed in. The problem is that it's checking for if(!empty($message) when I think it means if (empty($message)...

Steps to reproduce

Proposed resolution

Change code in constructor that creates a missing message to read:

   if (empty($message) && !empty($grantType)) {
      $message = "A token obtained using the $grantType grant has expired without a refresh, and cannot be renewed without user interaction";
    }

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lslalbai created an issue. See original summary.

fathershawn’s picture

Thank you - that sounds right from what you've posted and I'll have a look at the code

fathershawn’s picture

Title: Constructor for NonrenewableTokenException has possibly incorrect logic » Constructor for NonrenewableTokenException has incorrect message logic
Status: Active » Needs review

lslalbai’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and tested, thank you.

  • fathershawn committed 7a350287 on 4.1.x
    fix: #3612084 Constructor for NonrenewableTokenException has incorrect...
fathershawn’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

fathershawn’s picture

Status: Fixed » Closed (fixed)