Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw if access token is undefined or an empty string, don't make requests #170

Closed
wants to merge 3 commits into from

Conversation

chenhunghan
Copy link
Collaborator

Closes #168

@@ -139,12 +141,6 @@ class LensPlatformClient {
return undefined;
}

get authHeader(): Record<string, string> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not used at all, removed.

@@ -188,6 +184,10 @@ class LensPlatformClient {

const token = await getToken();

if (!token || token?.length === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incompatible with POST /users, which doesn't require a token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check and only send request if access token is valid, skip (or throw) if access token is "" or undefined.
2 participants