Indicate which access flow was used

This commit is contained in:
J. Ryan Stinnett 2019-12-05 16:23:00 +00:00
parent 2bdc16b4bd
commit d66dbdea61
2 changed files with 9 additions and 6 deletions

View file

@ -63,11 +63,14 @@ export const getSecretStorageKey = async ({ keys: keyInfos }) => {
throw new Error("Secret storage access canceled"); throw new Error("Secret storage access canceled");
} }
let key; let key;
const { passphrase } = info; if (input.passphrase) {
if (passphrase) { key = await deriveKey(
key = await deriveKey(input, passphrase.salt, passphrase.iterations); input.passphrase,
info.passphrase.salt,
info.passphrase.iterations,
);
} else { } else {
key = decodeRecoveryKey(input); key = decodeRecoveryKey(input.recoveryKey);
} }
// Save to cache to avoid future prompts in the current session // Save to cache to avoid future prompts in the current session
secretStorageKeys[name] = key; secretStorageKeys[name] = key;

View file

@ -65,11 +65,11 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
} }
_onPassPhraseNext = async () => { _onPassPhraseNext = async () => {
this.props.onFinished(this.state.passPhrase); this.props.onFinished({ passphrase: this.state.passPhrase });
} }
_onRecoveryKeyNext = async () => { _onRecoveryKeyNext = async () => {
this.props.onFinished(this.state.recoveryKey); this.props.onFinished({ recoveryKey: this.state.recoveryKey });
} }
_onPassPhraseChange = (e) => { _onPassPhraseChange = (e) => {