Customize nested NPM dependency

Joo Hee Paige Kim
1 min readAug 12, 2022

2022.08.12

Strapi Users & Permissions plugin allows to enable and configure providers, for end-users to login via a third-party provider to access the content of a font-end application through the Strapi application API. It uses Grant and Purest to enable authentication in our application. Among the providers, we are using Google for login.

For Google OAuth login, you can use the hd parameter to optimize the OpenID Connect flow for users of a particular domain associated with a Google Cloud organization. (Read more at hd.)

How to customize Grant library in order to use hd parameter in Strapi

  1. Fork Grant library
  2. Modify the codes as you need.
  • I add hd parameter in lib/flow/oauth2.js file

3. Update package.json by using its library

4. yarn install

https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/

--

--