Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
amcaplan committed Dec 1, 2024
1 parent 7c9a32a commit 3bb277c
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions packages/cli-kit/src/private/node/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,35 +307,6 @@ const getFirstOrganization = gql`
}
`

/**
* Validate if the current token is valid for partners API.
*
* @param partnersToken - Partners token.
* @returns A promise that resolves to true if the token is valid for partners API.
*/
async function hasPartnerAccount(partnersToken: string, userId?: string): Promise<boolean> {
const cacheKey = userId ?? partnersToken
const cachedStatus = getCachedPartnerAccountStatus(cacheKey)

if (cachedStatus) {
outputDebug(`Confirmed partner account exists from cache`)
return true
}

try {
await partnersRequest(getFirstOrganization, partnersToken)
setCachedPartnerAccountStatus(cacheKey)
return true
// eslint-disable-next-line no-catch-all/no-catch-all
} catch (error) {
if (error instanceof RequestClientError && error.statusCode === 404) {
return false
} else {
return true
}
}
}

/**
* Refresh the tokens for a given session.
*
Expand Down

0 comments on commit 3bb277c

Please sign in to comment.