Describe the bug
If the native AuthorizationClient returns an error, the MobileAuthorizationFrontend.getAccessToken function produces an unhandled promise rejection, which leaves _fetchingToken true, causing all future calls to getAccessToken to simply reject. (As an aside, the reject function call doesn't provide an error, so there is no error available to see what happened.)
To Reproduce
Steps to reproduce the behavior:
Run the iTwin Mobile Sample app.
Click on 'Hub iModels'
Click 'Cancel' when prompted for permission to sign in.
Go back to the Home Screen.
Click on 'Hub iModels'
Immediate error with no request to sign in.
Expected behavior
When an AuthorizationClient calls completion(nil, nil, error) on the completion parameter of getAccessToken, this should result in either an empty string being returned from getAccessToken in the TS code, or an error being thrown. (If the latter, that is a change over past behavior, but is arguable better than returning an empty string.)
Desktop (please complete the applicable information):
Describe the bug If the native AuthorizationClient returns an error, the MobileAuthorizationFrontend.getAccessToken function produces an unhandled promise rejection, which leaves _fetchingToken true, causing all future calls to getAccessToken to simply reject. (As an aside, the reject function call doesn't provide an error, so there is no error available to see what happened.)
To Reproduce Steps to reproduce the behavior:
Expected behavior When an AuthorizationClient calls completion(nil, nil, error) on the completion parameter of getAccessToken, this should result in either an empty string being returned from getAccessToken in the TS code, or an error being thrown. (If the latter, that is a change over past behavior, but is arguable better than returning an empty string.)
Desktop (please complete the applicable information):