Skip to content

To have a method or some helper to get the user access token from drupal #619

Open
@joshirohit100

Description

@joshirohit100

Package

next-drupal (NPM package)

Describe the feature request

I was checking the login flow on nextjs site with next-auth where user needs to login to site using creds.
To this, I was checking to getting the access token from drupal.
Initially I just did (based on quick checks on helper methods name) -

const drupal = new DrupalClien(options here for password grant and auth);
const token = drupal.getAccessToken()

but seems like ^^ only work for the client_credentials grant.

So it would be helpful to have a method to get the token from drupal rather doing / writing all like https://github.com/chapter-three/next-drupal/blob/main/examples/example-auth/pages/api/auth/%5B...nextauth%5D.ts for credentialHelpers

or refactor getAccessToken() to support this as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageA new issue that needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions