Skip to content

Commit

Permalink
Update Electron (#3316)
Browse files Browse the repository at this point in the history
PR fixes the issue when the user is unable to sign in with Google.

In the end, my assumption about the `User-Agent` header was correct and Google sign-in works with the recent Electron out of the box.
  • Loading branch information
4e6 authored Mar 10, 2022
1 parent 55dce7a commit 3ef18ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
[3305]: https://github.com/enso-org/enso/pull/3305
[3309]: https://github.com/enso-org/enso/pull/3309
[3310]: https://github.com/enso-org/enso/pull/3310
[3316]: https://github.com/enso-org/enso/pull/3316
[3236]: https://github.com/enso-org/enso/pull/3236
[3311]: https://github.com/enso-org/enso/pull/3311
[3317]: https://github.com/enso-org/enso/pull/3317
Expand Down
6 changes: 3 additions & 3 deletions app/ide-desktop/lib/client/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ let config = {
'compression-webpack-plugin': '^3.1.0',
'copy-webpack-plugin': '^5.1.1',
devtron: '^1.4.0',
electron: '12.2.3',
'electron-builder': '^22.10.5',
electron: '17.1.0',
'electron-builder': '^22.14.13',
'crypto-js': '4.0.0',
'electron-notarize': '1.0.0',
'electron-notarize': '1.1.1',
},

scripts: {
Expand Down
14 changes: 0 additions & 14 deletions app/ide-desktop/lib/client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ let mainWindow = null
let origin = null

async function main(args) {
setUserAgent()
runBackend()
console.log('Starting the IDE service.')
if (args.server !== false) {
Expand All @@ -460,19 +459,6 @@ async function main(args) {
}
}

/// Set custom user agent to fix the issue with Google authentication.
///
/// Google authentication doesn't work with the default Electron user agent. And
/// Google is quite picky about the values you provide. For example, just
/// removing Electron occurrences from the default user agent doesn't work. This
/// user agent was chosen by trial and error as a stable one.
///
/// https://github.com/firebase/firebase-js-sdk/issues/2478
function setUserAgent() {
const agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:70.0) Gecko/20100101 Firefox/70.0'
Electron.app.userAgentFallback = agent
Electron.session.defaultSession.setUserAgent(agent)
}
function urlParamsFromObject(obj) {
let params = []
for (let key in obj) {
Expand Down

0 comments on commit 3ef18ab

Please sign in to comment.