Skip to content

Commit b7a8be5

Browse files
committed
before restart
1 parent 38e19f5 commit b7a8be5

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src-electron/main-process/electron-main.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if (process.env.PROD) {
1818
}
1919

2020
let mainWindow;
21-
let authToken;
21+
let authCode;
2222
let authResponse;
2323

2424
function logEverywhere(...toBeLogged) {
@@ -34,37 +34,41 @@ const deeplink = new Deeplink({ app, mainWindow, protocol, isDev });
3434

3535
function getSlackAuth () {
3636
const authData = {
37-
code: authToken,
38-
client_secret: clientSecret,
3937
client_id: clientId,
38+
client_secret: clientSecret,
39+
code: authCode,
4040
redirect_uri: 'overvue://slack'
4141
}
42-
42+
4343
const request = net.request({
4444
method: 'POST',
45-
url: 'https://slack.com/api/openid.connect.token?'+ ,
45+
url: 'https://slack.com/api/openid.connect.token?' +
46+
'client_id=' + authData.client_id +
47+
'&client_secret=' + authData.client_secret +
48+
'&code=' + authData.authCode +
49+
'&redirect_uri=' + authData.redirect_uri,
4650
headers: {
4751
'Content-Type': 'application/x-www-form-urlencoded',
4852
// 'Content-Length': authData.length
4953
}
5054
})
5155

52-
5356
request.on('response', (response) => {
54-
authResponse = JSON.parse(response)
57+
logEverywhere('RESPONSE RECEIVED SON')
58+
JSON.parse(response)
5559
.then(data => {
5660
logEverywhere('response with token: ')
57-
logEverywhere(authResponse)
58-
mainWindow.webContents.send('tokenReceived', authResponse)
61+
logEverywhere(response)
62+
mainWindow.webContents.send('tokenReceived', response)
5963
})
60-
})
61-
request.end()
64+
})
65+
request.end()
6266
}
6367

6468
function getSlackToken () {
65-
deeplink.on("received", link => {
69+
return deeplink.on("received", link => {
6670
logEverywhere('auth worked here link: ', link)
67-
authToken = link.split('=')[1]
71+
authCode = link.split('=')[1]
6872
getSlackAuth()
6973
});
7074
}

src/components/slack_login/SlackLoginWindow.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default {
4444
methods: {
4545
slackOauth: function () {
4646
const slackBaseUrl = 'https://slack.com/openid/connect/authorize'
47+
// const slackBaseUrl = 'https://slack.com/oauth/v2/authorize'
4748
const responseType = 'code'
4849
const scope = 'openid profile'
4950
const clientId = slackApiStuff.clientId

0 commit comments

Comments
 (0)