Skip to content

OAuth2User.requestAccessToken method doesn't return token data #8

@PromiseFru

Description

@PromiseFru

Hello, I'm trying to use the SDK to get a user's token and store it so I can fetch and use it later. Everything works as expected but the OAuth2User.requestAccessToken method doesn't return the requested token it rather just updates the OAuth2User class using the OAuth2User.updateToken method.

Expected behavior

It will be great if the OAuth2User.requestAccessToken method can return the requested token so it can be stored externally.

Actual behavior

The OAuth2User.requestAccessToken method doesn't return the requested token it rather just updates the OAuth2User class using the OAuth2User.updateToken method.

Steps to reproduce the behavior

const authClient = new auth.OAuth2User({
    client_id: client_id,
    client_secret: client_secret,
    callback: "callback_url",
    scopes: ["tweet.write", "users.read", "offline.access"],
});

let Token = await authClient.requestAccessToken(code);
console.log(Token)

this gives an empty response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions