File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ pub struct App {
5656 pub passkey_sender : Sender < String > ,
5757 pub cancel_signal_sender : Sender < ( ) > ,
5858 pub passkey_input : Input ,
59+ pub show_password : bool ,
5960 pub mode : Mode ,
6061 pub selected_mode : Mode ,
6162 pub current_mode : Mode ,
@@ -113,6 +114,7 @@ impl App {
113114 let current_mode = adapter. device . mode . clone ( ) ;
114115
115116 let ( passkey_sender, passkey_receiver) = async_channel:: unbounded ( ) ;
117+ let show_password = false ;
116118 let ( cancel_signal_sender, cancel_signal_receiver) = async_channel:: unbounded ( ) ;
117119
118120 let authentication_required = Arc :: new ( AtomicBool :: new ( false ) ) ;
@@ -153,6 +155,7 @@ impl App {
153155 passkey_sender,
154156 cancel_signal_sender,
155157 passkey_input : Input :: default ( ) ,
158+ show_password,
156159 mode,
157160 selected_mode : Mode :: Station ,
158161 current_mode,
Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ pub async fn handle_key_events(
6060 app. cancel_auth ( ) . await ?;
6161 app. focused_block = FocusedBlock :: Device ;
6262 }
63+
64+ KeyCode :: Tab => {
65+ app. show_password = !app. show_password ;
66+ }
67+
6368 _ => {
6469 app. passkey_input
6570 . handle_event ( & crossterm:: event:: Event :: Key ( key_event) ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,12 @@ pub fn render(app: &mut App, frame: &mut Frame) {
2121 // Auth Popup
2222 if app. authentication_required . load ( Ordering :: Relaxed ) {
2323 app. focused_block = FocusedBlock :: AuthKey ;
24- Auth . render ( frame, app. passkey_input . value ( ) ) ;
24+ let censored_password = "*" . repeat ( app. passkey_input . value ( ) . len ( ) ) ;
25+ if !app. show_password {
26+ Auth . render ( frame, & censored_password) ;
27+ } else {
28+ Auth . render ( frame, app. passkey_input . value ( ) ) ;
29+ }
2530 }
2631
2732 // Access Point Popup
You can’t perform that action at this time.
0 commit comments