blob: 4b71d32fd746b85aa0b41172304b0c8f203528be (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import { observable } from 'mobx';
import { ipcRenderer } from 'electron';
const debug = require('debug')('Ferdium:feature:basicAuth');
const defaultState = {
isModalVisible: true,
service: null,
authInfo: null,
};
export const state = observable(defaultState);
export function resetState() {
Object.assign(state, defaultState);
}
export function sendCredentials(user, password) {
debug('Sending credentials to main', user, password);
ipcRenderer.send('feature-basic-auth-credentials', {
user,
password,
});
}
export function cancelLogin() {
debug('Cancel basic auth event');
ipcRenderer.send('feature-basic-auth-cancel');
}
|