File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -98,13 +98,11 @@ fn random_string(len: usize) -> String {
9898}
9999
100100fn hash_password ( password : & str ) -> anyhow:: Result < String > {
101- tokio:: task:: block_in_place ( || {
102- let phf = argon2:: Argon2 :: default ( ) ;
103- let salt = password_hash:: SaltString :: generate ( & mut password_hash:: rand_core:: OsRng ) ;
104- let password_hash = & password_hash:: PasswordHash :: generate ( phf, password, & salt)
105- . map_err ( |e| anyhow ! ( "Unable to hash password: {}" , e) ) ?;
106- Ok ( password_hash. to_string ( ) )
107- } )
101+ let phf = argon2:: Argon2 :: default ( ) ;
102+ let salt = password_hash:: SaltString :: generate ( & mut password_hash:: rand_core:: OsRng ) ;
103+ let password_hash = & password_hash:: PasswordHash :: generate ( phf, password, & salt)
104+ . map_err ( |e| anyhow ! ( "Unable to hash password: {}" , e) ) ?;
105+ Ok ( password_hash. to_string ( ) )
108106}
109107
110108fn extract_basic_auth_username ( request : & RequestInfo ) -> anyhow:: Result < & str > {
Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ async fn test_files_it_works() {
6363 }
6464}
6565
66-
6766async fn req_path ( path : & str ) -> Result < actix_web:: dev:: ServiceResponse , actix_web:: Error > {
6867 init_log ( ) ;
6968 let config = test_config ( ) ;
You can’t perform that action at this time.
0 commit comments