Skip to content

Commit bac3b50

Browse files
committed
Oauth functioning
1 parent b20492e commit bac3b50

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

app/electron/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ app.on('web-contents-created', (event, contents) => {
256256
'https://www.facebook.com',
257257
'https://www.smashingmagazine.com',
258258
'https://www.html5rocks.com',
259+
'app://rse/'
259260
];
260261

261262
// Log and prevent the app from redirecting to a new page
@@ -465,7 +466,7 @@ ipcMain.on('github', event => {
465466
github.close();
466467
win.webContents
467468
.executeJavaScript(`window.localStorage.setItem('ssid', '${ssid}')`)
468-
.then(result => win.loadURL(selfHost))
469+
.then(result => win.loadURL(`app://rse?=${ssid}`))
469470
.catch(err => console.log(err));
470471
}
471472
});

app/src/components/login/SignIn.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
165165
e.preventDefault();
166166
window.api.github();
167167
props.history.push('/');
168-
169168
}
170169
const responseFacebook = response => {
171170
if (response.accessToken) {

server/controllers/sessionController.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ sessionController.gitHubResponse = (req, res, next) => {
106106
res.status(500).json({ message: `${err.message} in gitHubResponse` })
107107
}
108108
);
109+
109110
};
110111

111112
sessionController.gitHubSendToken = (req, res, next) => {

server/models/reactypeModels.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
*/
1111
const mongoose = require('mongoose');
1212
const bcrypt = require('bcryptjs');
13-
const URI = process.env.NODE_ENV === 'production' ? process.env.URI : 'mongodb+srv://Daniel:[email protected]/Cluster0?retryWrites=true&w=majority';
14-
// const mongoURI = ('mongodb+srv://Daniel:[email protected]/Cluster0?retryWrites=true&w=majority');
13+
const mongoURI = 'mongodb+srv://Daniel:[email protected]/Cluster0?retryWrites=true&w=majority';
14+
const URI = process.env.NODE_ENV === 'production' ? mongoURI : 'mongodb+srv://Daniel:[email protected]/Cluster0?retryWrites=true&w=majority';
1515

1616
const SALT_WORK_FACTOR = 14;
1717
// connect to mongo db

server/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,26 @@
66
"engines": {
77
"node": "12.17.0"
88
},
9-
109
"scripts": {
1110
"test": "jest --verbose ",
1211
"test:watch": "jest --watch",
1312
"start": "cross-env NODE_ENV=production node server.js",
1413
"prod": "cross-env NODE_ENV=production server.js",
1514
"dev": "cross-env NODE_ENV=development nodemon server.js"
1615
},
17-
18-
1916
"keywords": [],
2017
"author": "",
2118
"license": "ISC",
2219
"dependencies": {
23-
"apollo-server-express": "^2.24.0",
20+
"apollo-server-express": "^2.24.0",
2421
"bcryptjs": "^2.4.3",
2522
"body-parser": "^1.19.0",
2623
"cookie-parser": "^1.4.5",
2724
"cors": "^2.8.5",
2825
"cross-env": "^7.0.2",
2926
"dotenv": "^8.2.0",
3027
"express": "^4.17.1",
31-
"graphql": "^15.5.0",
28+
"graphql": "^15.5.0",
3229
"mongoose": "^5.9.22",
3330
"nodemon": "^2.0.4",
3431
"passport": "^0.4.1",

server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ app.get(
5555
if (isDev) {
5656
return res.status(200).redirect(`http://localhost:8080?=${res.locals.ssid}`);
5757
} else {
58-
return res.status(200).redirect('app://rse');
58+
return res.status(200).redirect(`app://rse?=${res.locals.ssid}`);
5959
}
6060
}
6161
);

0 commit comments

Comments
 (0)