Skip to content

Commit

Permalink
Merge pull request #1142 from Soundnode/dev
Browse files Browse the repository at this point in the history
Merge dev into master
  • Loading branch information
jakejarrett committed Feb 22, 2020
2 parents ebcef22 + b4c2c19 commit 04ddd01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
13 changes: 9 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@ function authenticateUser() {

contents = authenticationWindow.webContents;

contents.on('did-get-redirect-request', (event, oldUrl, newUrl) => {
contents.on('did-navigate', (_event, url, httpResponseCode) => {
const access_tokenStr = 'access_token=';
const expires_inStr = '&expires_in';
let accessToken;

if (newUrl.indexOf('access_token=') < 0) {
if (url.indexOf('access_token=') < 0) {
return false;
}

accessToken = newUrl.substring(newUrl.indexOf(access_tokenStr) + 13, newUrl.indexOf(expires_inStr));
accessToken = url.substring(url.indexOf(access_tokenStr) + 13, url.indexOf(expires_inStr));

accessToken = accessToken.split('&scope=')[0];

setUserData(accessToken);
authenticationWindow.destroy();
Expand Down Expand Up @@ -93,7 +95,10 @@ function initMainWindow() {
minWidth: 800,
minHeight: 640,
center: true,
frame: false
frame: false,
webPreferences: {
nodeIntegration: true
}
});

mainWindow.loadURL(`file://${__dirname}/app/index.html`);
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
"webpack:dev": "./node_modules/.bin/webpack -d --watch --config ./webpack.dev.js",
"sass:prod": "./node_modules/.bin/node-sass --include-path ./app/public/stylesheets/sass --output-style compressed ./app/public/stylesheets/sass/app.scss ./app/public/stylesheets/css/app.css",
"sass:dev": "./node_modules/.bin/node-sass --recursive --include-path ./app/public/stylesheets/sass --output-style expanded ./app/public/stylesheets/sass/app.scss ./app/public/stylesheets/css/app.css",
"package:osx": "electron-packager ./ Soundnode --platform=darwin --out ./dist/Soundnode --electron-version 1.4.4 --overwrite --icon ./app/soundnode.ico",
"package:linux": "electron-packager ./ Soundnode --platform=linux --out ./dist/Soundnode --electron-version 1.4.4 --overwrite --icon ./app/soundnode.icns",
"package:win32": "electron-packager ./ Soundnode --platform=win32 --out ./dist/Soundnode --electron-version 1.4.4 --overwrite --icon ./app/soundnode.icns",
"package:osx": "electron-packager ./ Soundnode --platform=darwin --out ./dist/Soundnode --electron-version 8.0.1 --overwrite --icon ./app/soundnode.ico",
"package:linux": "electron-packager ./ Soundnode --platform=linux --out ./dist/Soundnode --electron-version 8.0.1 --overwrite --icon ./app/soundnode.icns",
"package:win32": "electron-packager ./ Soundnode --platform=win32 --out ./dist/Soundnode --electron-version 8.0.1 --overwrite --icon ./app/soundnode.icns",
"package:all": "npm run package:osx && npm run package:linux && npm run package:win32"
},
"author": "Michael Lancaster",
"license": "GPL-3.0",
"devDependencies": {
"babel-core": "6.24.1",
"babel-core": "6.26.3",
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"babel-register": "^6.23.0",
"electron": "^1.6.11",
"electron-packager": "^8.5.1",
"electron": "^8.0.1",
"electron-packager": "^14.2.1",
"eslint": "^4.0.0",
"eslint-plugin-react": "^7.1.0",
"install": "^0.10.1",
Expand All @@ -46,18 +46,18 @@
"angular-sanitize": "^1.6.2",
"angular-toastr": "^2.1.1",
"angular-ui-router": "^0.4.2",
"electron-window-state": "^4.0.2",
"electron-window-state": "^5.0.0",
"font-awesome": "^4.7.0",
"fs-extra": "^3.0.1",
"fs-extra": "^8.0.0",
"jquery": "^3.1.1",
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"moment": "^2.17.1",
"ng-dialog": "^1.0.0",
"ng-infinite-scroll": "^1.3.0",
"normalize.css": "^7.0.0",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"normalize.css": "^8.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"toastr": "^2.1.2",
"universal-analytics": "^0.4.8",
"user-home": "^2.0.0"
Expand Down

0 comments on commit 04ddd01

Please sign in to comment.