Skip to content

Commit

Permalink
wip: installed keytar, getting an error, need help
Browse files Browse the repository at this point in the history
  • Loading branch information
csndra0504 committed Jun 30, 2017
1 parent 85dfc21 commit 0243e55
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
13 changes: 13 additions & 0 deletions app/actions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import co from 'co';
import keytar from 'keytar';
import RethinkDbService from './services/rethinkdb.service';
import ReQLEval from './services/reql-eval.service';
import { convertStringsToDates } from './services/date-type.service'
Expand Down Expand Up @@ -285,3 +286,15 @@ export function writeConfigFile() {
});
}
}

export function addKey(service, account, password) {
return (dispatch, getState) => {
keytar.addPassword(service, account, password);
// const state = getState();
// return configService.writeConfigFile({
// email: state.main.email,
// created: state.main.created,
// connections: state.connections
// });
}
}
5 changes: 3 additions & 2 deletions app/components/Sidebar/Connections/connections.actions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { writeConfigFile } from '../../../actions';
import { writeConfigFile, addKey } from '../../../actions';
import * as types from '../../../action-types';
import { selectConnection } from './selectedConnection.actions';

Expand All @@ -9,7 +9,8 @@ export function addConnection(connection) {
connection: connection
});
dispatch(writeConfigFile());

dispatch(addKey('ReQLPro', connection.user, connection.password));
dispatch(addKey('ReQLPro', connection.host, connection.ca));
// Grab the connection from the updated array of connections, which will have the index property
const conns = getState().connections;
dispatch(selectConnection(conns[conns.length - 1]));
Expand Down
2 changes: 1 addition & 1 deletion app/components/modals/ConnectionForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ConnectionForm extends Component {
</Field>
</div>
<div className="col-sm-6">
<label>Pass</label>
<label>Password</label>
<Field model=".pass">
<FormGroup validationState={valStatePass}>
<input className="form-control" type="password" id="pass"/>
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
"font-awesome": "^4.5.0",
"immutability-helper": "^2.0.0",
"immutable": "^3.8.1",
"keytar": "^4.0.3",
"node-loader": "^0.6.0",
"node-uuid": "^1.4.7",
"react": "^15.4.2",
"react-dom": "^15.4.2",
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ module.exports = {
}, {
test: /\.(json)$/,
loader: 'json-loader'
} , {
test: /\.node$/,
loader: 'node-loader'
}]
}
};
3 changes: 3 additions & 0 deletions webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ module.exports = {
}, {
test: /\.(json)$/,
loader: 'json-loader'
}, {
test: /\.node$/,
loader: 'node-loader'
}]
}
};

0 comments on commit 0243e55

Please sign in to comment.