next-drupal icon indicating copy to clipboard operation
next-drupal copied to clipboard

Oauth2 authorization not uses/considers the fetcher and getAccessToken() directly calls fetch() method

Open joshirohit100 opened this issue 2 years ago • 2 comments

https://github.com/chapter-three/next-drupal/blob/main/packages/next-drupal/src/client.ts#L1323 - Directly calls the fetch() method while calling drupal api to get the access token and not considers/uses the fetcher if added any.

Use case -

  • My drupal / backend url is SSO protected. This means I need to pass some extra param (some code) to url or as cookie to bypass the SSO
  • This means, getAccessToken() won't work for me and I have to override the auth mechanism and can not use OOTB thing

Sol - use/check the fetcher with the getAccessToken()

See https://github.com/acquia/next-acms/wiki/Using-Next.js-with-Acquia-Cloud-IDE for more info :)

joshirohit100 avatar Aug 29 '22 09:08 joshirohit100

Ah. Nice catch. We'll fix this. Thank you.

shadcn avatar Aug 29 '22 10:08 shadcn

Pull Request - https://github.com/chapter-three/next-drupal/pull/287

joshirohit100 avatar Aug 31 '22 08:08 joshirohit100