openid / AppAuth-JS

JavaScript client SDK for communicating with OAuth 2.0 and OpenID Connect providers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nodeIntegration false by default in 2021

rdylina opened this issue · comments

Expected Behavior

[REQUIRED] Describe expected behavior

NodeJS native require() should work in root of index.html

Describe the problem

[REQUIRED] Actual Behavior

require() not a defined function

[REQUIRED] Steps to reproduce the behavior

npm run start, open dev inspection, view console

[REQUIRED] Environment

  • AppAuth-JS version: current version as of 8.15.2021
  • AppAuth-JS Environment (Node, Browser (UserAgent), ...): Electron 12.0.2
  • Source code snippts (inline or JSBin)

Fix is applied to index.ts by making the following change starting on line 27
w = new BrowserWindow(
{
width: 1280, height: 720, icon: 'assets/app_icon.png',
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
}
});