Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth token expires #765

Open
reinvanoyen opened this issue May 23, 2024 · 1 comment
Open

OAuth token expires #765

reinvanoyen opened this issue May 23, 2024 · 1 comment
Labels
question Question asked by a user triage A new issue that needs triage

Comments

@reinvanoyen
Copy link

Package

next-drupal (NPM package)

Ask the question

Hi all,

We're using next-drupal 1.6.0 in our next 14.2.2 project. Our JSON:API uses oauth for authentication. This is how we initialise our DrupalClient:

new DrupalClient(DRUPAL_BASE_URL, {
     apiPrefix: "/api",
     auth: {
          clientId: DRUPAL_CLIENT_ID,
          clientSecret: DRUPAL_CLIENT_SECRET,
          url: `/oauth/token`,
     },
});

Now, unfortunately when using the endpoints on runtime, we get expired tokens after a while, causing our application to crash. We proceeded by using SSG for most parts of website and that works like a charm. Of course it's a requirement for some features to be able to fetch resources on the go, has anyone had any problems with this?

Are there any reported issues on token refreshing not working? Is this desired behavior?

Additional context

next-drupal 1.6.0
next 14.2.2

@reinvanoyen reinvanoyen added question Question asked by a user triage A new issue that needs triage labels May 23, 2024
@MontiMarco92
Copy link

I've also experienced this expiration token issue, causing drupal to return "Unauthorized" access for various resource calls. It think it might be related to the Next js 14 caching system, however I haven't seem able to pinpoint the problem and fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question asked by a user triage A new issue that needs triage
Projects
None yet
Development

No branches or pull requests

2 participants