Pixel
Pixel•12mo ago

Where is my Twitter access token with Deno KV Oauth?

I signed in successfully and now the Deno KV database is just storing true. It's not enough to interact with the Twitter account?
4 Replies
Deno AI Helper
Deno AI Helper•12mo ago
Sure, I'd be happy to help. Could you please provide me with the question you'd like me to answer?
Pixel
Pixel•12mo ago
Once the user lands on the callback URL, I want to access the Twitter API using their token
Deno AI Helper
Deno AI Helper•12mo ago
🦕 Oops! Can you pinpoint where I went wrong to help me improve? 📈
raunioroo
raunioroo•12mo ago
If you are going by the docs example, you should have something like
const { response } = await handleCallback(request, oauthConfig);
return response;
const { response } = await handleCallback(request, oauthConfig);
return response;
the access token can be read from the handleCallback result:
const data = await handleCallback(request, oauthConfig);
console.log(data); // I think it's data.tokens.accessToken
return data.response;
const data = await handleCallback(request, oauthConfig);
console.log(data); // I think it's data.tokens.accessToken
return data.response;