Skip to content

Commit 04ddd01

Browse files
authored
Merge pull request #1142 from Soundnode/dev
Merge dev into master
2 parents ebcef22 + b4c2c19 commit 04ddd01

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

main.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@ function authenticateUser() {
5454

5555
contents = authenticationWindow.webContents;
5656

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

62-
if (newUrl.indexOf('access_token=') < 0) {
62+
if (url.indexOf('access_token=') < 0) {
6363
return false;
6464
}
6565

66-
accessToken = newUrl.substring(newUrl.indexOf(access_tokenStr) + 13, newUrl.indexOf(expires_inStr));
66+
accessToken = url.substring(url.indexOf(access_tokenStr) + 13, url.indexOf(expires_inStr));
67+
68+
accessToken = accessToken.split('&scope=')[0];
6769

6870
setUserData(accessToken);
6971
authenticationWindow.destroy();
@@ -93,7 +95,10 @@ function initMainWindow() {
9395
minWidth: 800,
9496
minHeight: 640,
9597
center: true,
96-
frame: false
98+
frame: false,
99+
webPreferences: {
100+
nodeIntegration: true
101+
}
97102
});
98103

99104
mainWindow.loadURL(`file://${__dirname}/app/index.html`);

package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
"webpack:dev": "./node_modules/.bin/webpack -d --watch --config ./webpack.dev.js",
1818
"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",
1919
"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",
20-
"package:osx": "electron-packager ./ Soundnode --platform=darwin --out ./dist/Soundnode --electron-version 1.4.4 --overwrite --icon ./app/soundnode.ico",
21-
"package:linux": "electron-packager ./ Soundnode --platform=linux --out ./dist/Soundnode --electron-version 1.4.4 --overwrite --icon ./app/soundnode.icns",
22-
"package:win32": "electron-packager ./ Soundnode --platform=win32 --out ./dist/Soundnode --electron-version 1.4.4 --overwrite --icon ./app/soundnode.icns",
20+
"package:osx": "electron-packager ./ Soundnode --platform=darwin --out ./dist/Soundnode --electron-version 8.0.1 --overwrite --icon ./app/soundnode.ico",
21+
"package:linux": "electron-packager ./ Soundnode --platform=linux --out ./dist/Soundnode --electron-version 8.0.1 --overwrite --icon ./app/soundnode.icns",
22+
"package:win32": "electron-packager ./ Soundnode --platform=win32 --out ./dist/Soundnode --electron-version 8.0.1 --overwrite --icon ./app/soundnode.icns",
2323
"package:all": "npm run package:osx && npm run package:linux && npm run package:win32"
2424
},
2525
"author": "Michael Lancaster",
2626
"license": "GPL-3.0",
2727
"devDependencies": {
28-
"babel-core": "6.24.1",
28+
"babel-core": "6.26.3",
2929
"babel-loader": "^7.0.0",
3030
"babel-preset-es2015": "^6.22.0",
3131
"babel-preset-react": "^6.23.0",
3232
"babel-preset-stage-0": "^6.22.0",
3333
"babel-register": "^6.23.0",
34-
"electron": "^1.6.11",
35-
"electron-packager": "^8.5.1",
34+
"electron": "^8.0.1",
35+
"electron-packager": "^14.2.1",
3636
"eslint": "^4.0.0",
3737
"eslint-plugin-react": "^7.1.0",
3838
"install": "^0.10.1",
@@ -46,18 +46,18 @@
4646
"angular-sanitize": "^1.6.2",
4747
"angular-toastr": "^2.1.1",
4848
"angular-ui-router": "^0.4.2",
49-
"electron-window-state": "^4.0.2",
49+
"electron-window-state": "^5.0.0",
5050
"font-awesome": "^4.7.0",
51-
"fs-extra": "^3.0.1",
51+
"fs-extra": "^8.0.0",
5252
"jquery": "^3.1.1",
5353
"lodash": "^4.17.4",
5454
"mkdirp": "^0.5.1",
5555
"moment": "^2.17.1",
5656
"ng-dialog": "^1.0.0",
5757
"ng-infinite-scroll": "^1.3.0",
58-
"normalize.css": "^7.0.0",
59-
"react": "^15.5.4",
60-
"react-dom": "^15.5.4",
58+
"normalize.css": "^8.0.0",
59+
"react": "^16.0.0",
60+
"react-dom": "^16.0.0",
6161
"toastr": "^2.1.2",
6262
"universal-analytics": "^0.4.8",
6363
"user-home": "^2.0.0"

0 commit comments

Comments
 (0)