2022-10-28 15:34:35 +00:00
|
|
|
#include "cli_helpers.h"
|
|
|
|
#include <cli/cli.h>
|
|
|
|
|
2022-11-02 21:41:17 +00:00
|
|
|
bool totp_cli_ensure_authenticated(PluginState* plugin_state, Cli* cli) {
|
2022-10-28 15:34:35 +00:00
|
|
|
if(plugin_state->current_scene == TotpSceneAuthentication) {
|
|
|
|
TOTP_CLI_PRINTF("Pleases enter PIN on your flipper device\r\n");
|
|
|
|
|
|
|
|
while(plugin_state->current_scene == TotpSceneAuthentication &&
|
|
|
|
!cli_cmd_interrupt_received(cli)) {
|
|
|
|
furi_delay_ms(100);
|
|
|
|
}
|
|
|
|
|
|
|
|
TOTP_CLI_DELETE_LAST_LINE();
|
2022-11-02 21:41:17 +00:00
|
|
|
fflush(stdout);
|
2022-10-28 15:34:35 +00:00
|
|
|
|
|
|
|
if(plugin_state->current_scene == TotpSceneAuthentication) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|