Once user deny the power up authorization can't reauthorize the power up

Once the user denies the authorization for the power up then we can’t open the authorization popup. By default the token is set to “&error=Token%20request%20rejected”. We are currently using getRestApi() to authorize the power up.

How to allow users to reauthorize the power up.

I have gone through this blog: Add Error To OAuth Deny

It says if the user denies then the token is set to “&error=Token%20request%20rejected” but this blog does not explain a way to allow the users to reauthorize the power up.

During the tests, I noticed that when a user rejects the OAuth authorization flow, the user token is saved anyway with an incorrect token value “&error=Token%20request%20rejected".

To fix this, we recommend using the “t.getRestApi().getToken()” request to check the token value, and if the token value matches the incorrect token listed above, use the “t.getRestApi().clearToken()” request to remove the incorrect token.