You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the method body it seems like it calls the /v1/users/:id/oauth_access_tokens/:provider endpoint of the backend API, which does makes sense.
However, in the backend documentation the data from this endpoint is an array of objects with the "object" property having the value "oauth_access_token", which obviously doesn't matches the User type:
It seems like there's missing an OAuthAccessToken and its companion OAuthAccessTokenJSON type, and the UserAPI.getUserOauthAccessToken method should return Promise<OAuthAccessToken[]> rather than Promise<User>.
The text was updated successfully, but these errors were encountered:
Provide the Frontend API key from your application dashboard.not applicablePackage + Version
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/clerk-expo
@clerk/backend-core
2.9.1@clerk/clerk-sdk-node
@clerk/edge
Version:
Browser/OS
Not applicable
Description
It seems like the method
getUserOauthAccessToken
in the classUserAPI
has the wrong return type: https://github.com/clerkinc/javascript/blob/250a47daf561928e7d09b48873b19be4de28a581/packages/backend-core/src/api/endpoints/UserApi.ts#L120The method returns the return value from
this.APIClient.request<User>
, which makes the return typePromise<User>
, and this doesn't seem correct given the name of the function, the backend API docs and the return data from the API.The
User
type doesn't match the data returned from the method:https://github.com/clerkinc/javascript/blob/250a47daf561928e7d09b48873b19be4de28a581/packages/backend-core/src/api/resources/User.ts#L7
From the method body it seems like it calls the
/v1/users/:id/oauth_access_tokens/:provider
endpoint of the backend API, which does makes sense.However, in the backend documentation the data from this endpoint is an array of objects with the
"object"
property having the value"oauth_access_token"
, which obviously doesn't matches theUser
type:https://reference.clerk.dev/reference/backend-api-reference/users#retrieve-the-oauth-access-token-of-a-user
Here's the example return value:
When calling the function, I get a similar JSON object as well:
I can't find a type in the JS API matching this type, for instance no object with this object type can be found in the
ObjectType
enum:https://github.com/clerkinc/javascript/blob/250a47daf561928e7d09b48873b19be4de28a581/packages/backend-core/src/api/resources/JSON.ts#L12
Nor do I find the string
oauth_access_token
in the entire repo:https://github.com/clerkinc/javascript/search?q=oauth_access_token
It seems like there's missing an
OAuthAccessToken
and its companionOAuthAccessTokenJSON
type, and theUserAPI.getUserOauthAccessToken
method should returnPromise<OAuthAccessToken[]>
rather thanPromise<User>
.The text was updated successfully, but these errors were encountered: