Add support for storing SSH keys on user accounts

This commit is contained in:
DaneEveritt 2022-05-14 17:31:53 -04:00
parent 5705d7dbdd
commit 97280a62a2
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
20 changed files with 678 additions and 6 deletions

View file

@ -6,7 +6,7 @@ export interface FlashStore {
items: FlashMessage[];
addFlash: Action<FlashStore, FlashMessage>;
addError: Action<FlashStore, { message: string; key?: string }>;
clearAndAddHttpError: Action<FlashStore, { error: any, key?: string }>;
clearAndAddHttpError: Action<FlashStore, { error?: Error | any | null; key?: string }>;
clearFlashes: Action<FlashStore, string | void>;
}
@ -29,8 +29,19 @@ const flashes: FlashStore = {
state.items.push({ type: 'error', title: 'Error', ...payload });
}),
clearAndAddHttpError: action((state, { key, error }) => {
state.items = [ { type: 'error', title: 'Error', key, message: httpErrorToHuman(error) } ];
clearAndAddHttpError: action((state, payload) => {
if (!payload.error) {
state.items = [];
} else {
console.error(payload.error);
state.items = [ {
type: 'error',
title: 'Error',
key: payload.key,
message: httpErrorToHuman(payload.error),
} ];
}
}),
clearFlashes: action((state, payload) => {