question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getAccessToken() return type should be string | null, not just string

See original GitHub issue

Since the method internally calls storage.getItem(), it can return either string or null (if there is no access token in the storage). However, currently the typings say that it always returns a string, which is wrong and needs to be updated.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jeroenheijmanscommented, Mar 7, 2019

Ahhh, check! Thx for sticking with it, I now see what you mean 😅 (I tend to miss info if it’s only in the title and not also in the issue body, I should work on this.)

Apologies for taking so much of your time with a reading mistake on my end. FWIW I presume it’s taught me a useful lesson!

1reaction
Maximaximumcommented, Mar 7, 2019

The docs for the OAuthStorage are fine. The problem is with getAccessToken() return type (and maybe some other functions - I did not take a look)

Read more comments on GitHub >

github_iconTop Results From Across the Web

getAccessToken() returns null - java
As Priyam Gupta said, this is solved with api.amazon.com/user/profile?access_token= And the code I used to solve it is: String accessToken ...
Read more >
AuthToken.getAccessToken()'s return value is NULL
Tried the following code to retrieve access token in Auth.RegistrationHandler's createUser method but the return value is NULL. String ...
Read more >
Auth.AuthToken.getAccessToken returns null
I am doing pretty much the same in exec anon: AuthProvider pcs = [SELECT Id FROM AuthProvider WHERE DeveloperName = 'PCS']; String accessToken...
Read more >
Call Your API Using the Authorization Code Flow
This tutorial will help you call your own API using the Authorization Code Flow. If you want to learn how the flow works...
Read more >
AuthenticationResult Class (Microsoft.Identity.Client)
This property will be null if tenant information is not returned by the service. TokenType. Identifies the type of access token. By default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found