diff options
Diffstat (limited to 'src/features/basicAuth/index.js')
-rw-r--r-- | src/features/basicAuth/index.js | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/features/basicAuth/index.js b/src/features/basicAuth/index.js index 51625ea55..e43d51d15 100644 --- a/src/features/basicAuth/index.js +++ b/src/features/basicAuth/index.js | |||
@@ -1,21 +1,12 @@ | |||
1 | import { ipcRenderer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | import { observable } from 'mobx'; | ||
3 | 2 | ||
4 | import BasicAuthComponent from './Component'; | 3 | import BasicAuthComponent from './Component'; |
5 | 4 | ||
6 | const debug = require('debug')('Ferdi:feature:basicAuth'); | 5 | import { state as ModalState } from './store'; |
7 | |||
8 | const defaultState = { | ||
9 | isModalVisible: true, | ||
10 | service: null, | ||
11 | authInfo: null, | ||
12 | }; | ||
13 | 6 | ||
14 | export const state = observable(defaultState); | 7 | const debug = require('debug')('Ferdi:feature:basicAuth'); |
15 | 8 | ||
16 | export function resetState() { | 9 | const state = ModalState; |
17 | Object.assign(state, defaultState); | ||
18 | } | ||
19 | 10 | ||
20 | export default function initialize() { | 11 | export default function initialize() { |
21 | debug('Initialize basicAuth feature'); | 12 | debug('Initialize basicAuth feature'); |
@@ -40,19 +31,4 @@ export function mainIpcHandler(mainWindow, authInfo) { | |||
40 | }); | 31 | }); |
41 | } | 32 | } |
42 | 33 | ||
43 | export function sendCredentials(user, password) { | ||
44 | debug('Sending credentials to main', user, password); | ||
45 | |||
46 | ipcRenderer.send('feature-basic-auth-credentials', { | ||
47 | user, | ||
48 | password, | ||
49 | }); | ||
50 | } | ||
51 | |||
52 | export function cancelLogin() { | ||
53 | debug('Cancel basic auth event'); | ||
54 | |||
55 | ipcRenderer.send('feature-basic-auth-cancel'); | ||
56 | } | ||
57 | |||
58 | export const Component = BasicAuthComponent; | 34 | export const Component = BasicAuthComponent; |