Skip to content

Commit 59998da

Browse files
committed
not too much added
1 parent ebdc0e8 commit 59998da

File tree

3 files changed

+81
-9
lines changed

3 files changed

+81
-9
lines changed

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { app, BrowserWindow } from 'electron'
1+
import { app, BrowserWindow, shell, ipcMain } from 'electron'
22

33
/**
44
* Set `__statics` path to static files in production;
@@ -12,10 +12,22 @@ if (process.env.PROD) {
1212

1313
let mainWindow
1414

15+
ipcMain.handle('slackAuth', slackAuth)
16+
17+
function slackAuth () {
18+
shell.openExternal()
19+
app.listen(443, () => {
20+
console.log('Listening on port 443')
21+
})
22+
app.listen()
23+
}
24+
1525
function createWindow () {
1626
/**
1727
* Initial window options
1828
*/
29+
30+
1931
mainWindow = new BrowserWindow({
2032
width: 1000,
2133
height: 600,
@@ -25,16 +37,23 @@ function createWindow () {
2537
webSecurity: false
2638
}
2739
})
28-
40+
2941
mainWindow.loadURL(process.env.APP_URL)
30-
42+
3143
mainWindow.on('closed', () => {
3244
mainWindow = null
3345
})
46+
// shell.openExternal('http://google.com/')
3447
}
3548

3649
app.on('ready', createWindow)
3750

51+
// listener for OAuth response with URL encoded auth token
52+
// ipcMain.once('slackAuth', )
53+
// app.listen(443, () => {
54+
55+
// })
56+
3857
app.on('window-all-closed', () => {
3958
if (process.platform !== 'darwin') {
4059
app.quit()

src/components/slack_login/SlackLoginWindow.vue

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,77 @@
33
<!--
44
Slack Login Button:
55
-->
6-
<a href='https://slack.com/openid/connect/authorize?scope=openid%20profile&amp;response_type=code&amp;redirect_uri=https%3A%2F%2Flocalhost&amp;client_id=2696943977700.2696948669268' style="align-items:center;color:#fff;background-color:#4A154B;border:0;border-radius:48px;display:inline-flex;font-family:Lato, sans-serif;font-size:16px;font-weight:600;height:48px;justify-content:center;text-decoration:none;width:256px"><svg xmlns="http://www.w3.org/2000/svg" style="height:20px;width:20px;margin-right:12px" viewBox="0 0 122.8 122.8"><path d="M25.8 77.6c0 7.1-5.8 12.9-12.9 12.9S0 84.7 0 77.6s5.8-12.9 12.9-12.9h12.9v12.9zm6.5 0c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V77.6z" fill="#e01e5a"></path><path d="M45.2 25.8c-7.1 0-12.9-5.8-12.9-12.9S38.1 0 45.2 0s12.9 5.8 12.9 12.9v12.9H45.2zm0 6.5c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H12.9C5.8 58.1 0 52.3 0 45.2s5.8-12.9 12.9-12.9h32.3z" fill="#36c5f0"></path><path d="M97 45.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9-5.8 12.9-12.9 12.9H97V45.2zm-6.5 0c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V12.9C64.7 5.8 70.5 0 77.6 0s12.9 5.8 12.9 12.9v32.3z" fill="#2eb67d"></path><path d="M77.6 97c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9-12.9-5.8-12.9-12.9V97h12.9zm0-6.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H77.6z" fill="#ecb22e"></path></svg>Sign in with Slack</a>
6+
<q-btn @click="slackOauth" class="slackBtn" >
7+
8+
<svg xmlns="http://www.w3.org/2000/svg" style="height:20px;width:20px;margin-right:12px" viewBox="0 0 122.8 122.8">
9+
<path d="M25.8 77.6c0 7.1-5.8 12.9-12.9 12.9S0 84.7 0 77.6s5.8-12.9 12.9-12.9h12.9v12.9zm6.5 0c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V77.6z" fill="#e01e5a"></path>
10+
<path d="M45.2 25.8c-7.1 0-12.9-5.8-12.9-12.9S38.1 0 45.2 0s12.9 5.8 12.9 12.9v12.9H45.2zm0 6.5c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H12.9C5.8 58.1 0 52.3 0 45.2s5.8-12.9 12.9-12.9h32.3z" fill="#36c5f0"></path>
11+
<path d="M97 45.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9-5.8 12.9-12.9 12.9H97V45.2zm-6.5 0c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V12.9C64.7 5.8 70.5 0 77.6 0s12.9 5.8 12.9 12.9v32.3z" fill="#2eb67d"></path>
12+
<path d="M77.6 97c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9-12.9-5.8-12.9-12.9V97h12.9zm0-6.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H77.6z" fill="#ecb22e"></path>
13+
</svg>Sign in with Slack
14+
</q-btn>
715
<!--
816
Skip button:
917
-->
1018
<br/>
11-
<a href='/' style="align-items:center;display:inline-flex;font-family:Lato, sans-serif;font-size:14px;font-weight:600;height:36px;width:128px;text-decoration:none;justify-content:center">Skip</a>
19+
<q-btn @click="" class="skipBtn" >Skip</q-btn>
1220
</div>
1321

1422
</template>
1523

1624
<script>
17-
import { mapState, mapActions } from 'vuex'
25+
// import { mapState, mapActions } from 'vuex'
26+
import localforage from 'localforage'
27+
import { shell } from 'electron'
28+
import slackApiStuff from '../../../secretStuff/slackApiStuff.js'
29+
// const oauthURL =
1830
1931
export default {
20-
32+
name: 'SlackLoginWindow',
33+
data () {
34+
return {
35+
oauthURL: slackApiStuff.oauthURL
36+
}
37+
},
38+
methods: {
39+
slackOauth: function () {
40+
console.log('clicked')
41+
// shell.openExternal(this.oauthURL)
42+
window.open(this.oauthURL, '_blank')
43+
}
44+
}
2145
}
2246
</script>
2347

2448
<style>
2549
50+
.slackBtn {
51+
align-items:center;
52+
color:#fff;
53+
background-color:#4A154B;
54+
border:0;
55+
border-radius:48px;
56+
display:inline-flex;
57+
font-family:Lato, sans-serif;
58+
font-size:16px;
59+
font-weight:600;
60+
height:48px;
61+
justify-content:center;
62+
text-decoration:none;
63+
width:256px;
64+
}
65+
66+
.skipBtn {
67+
align-items:center;
68+
color:#000;
69+
display:inline-flex;
70+
font-family:Lato, sans-serif;
71+
font-size:14px;
72+
font-weight:600;
73+
height:36px;
74+
width:128px;
75+
text-decoration:none;
76+
justify-content:center;
77+
}
78+
2679
</style>

src/router/routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
const routes = [
33
{
44
path: '/',
5-
// redirect: 'https://slack.com/openid/connect/authorize?scope=openid%20profile&amp;response_type=code&amp;redirect_uri=https%3A%2F%2Flocalhost/slacklogin&amp;client_id=2696943977700.2696948669268'
5+
// redirect: ''
66
component: () => import('components/slack_login/SlackLoginWindow.vue')
77
},
88
{
99
path: '/slacklogin',
10-
// redirect: 'https://slack.com/openid/connect/authorize?scope=openid%20profile&amp;response_type=code&amp;redirect_uri=https%3A%2F%2Flocalhost/slacklogin&amp;client_id=2696943977700.2696948669268'
10+
// redirect: ''
1111
redirect: '/pow'
1212
},
1313
{

0 commit comments

Comments
 (0)