@@ -87,6 +87,7 @@ pub async fn dispatch(test: &str, db_name: &str) {
8787
8888 // "resubscribe" => exec_resubscribe(),
8989 //
90+ "reauth" => exec_reauth ( db_name) . await ,
9091 "reauth-part-1" => exec_reauth_part_1 ( db_name) . await ,
9192 "reauth-part-2" => exec_reauth_part_2 ( db_name) . await ,
9293
@@ -1722,8 +1723,13 @@ async fn exec_insert_primitives_as_strings(db_name: &str) {
17221723// }
17231724
17241725#[ cfg( not( target_arch = "wasm32" ) ) ]
1725- fn creds_store ( ) -> credentials:: File {
1726- credentials:: File :: new ( "rust-sdk-test" )
1726+ fn creds_store ( db_name : & str ) -> credentials:: File {
1727+ credentials:: File :: new ( format ! ( "rust-sdk-test-{db_name}" ) )
1728+ }
1729+
1730+ async fn exec_reauth ( db_name : & str ) {
1731+ exec_reauth_part_1 ( db_name) . await ;
1732+ exec_reauth_part_2 ( db_name) . await ;
17271733}
17281734
17291735/// Part of the `reauth` test, this connects to Spacetime to get new credentials,
@@ -1735,10 +1741,11 @@ async fn exec_reauth_part_1(db_name: &str) {
17351741 let name = db_name. to_owned ( ) ;
17361742
17371743 let save_result = test_counter. add_test ( "save-credentials" ) ;
1744+ let creds = creds_store ( db_name) ;
17381745
17391746 DbConnection :: builder ( )
1740- . on_connect ( |_, _identity, token| {
1741- save_result ( creds_store ( ) . save ( token) . map_err ( Into :: into) ) ;
1747+ . on_connect ( move |_, _identity, token| {
1748+ save_result ( creds . save ( token) . map_err ( Into :: into) ) ;
17421749 } )
17431750 . on_connect_error ( |_ctx, error| panic ! ( "Connect failed: {error:?}" ) )
17441751 . with_database_name ( name)
@@ -1762,7 +1769,7 @@ async fn exec_reauth_part_2(db_name: &str) {
17621769
17631770 let creds_match_result = test_counter. add_test ( "creds-match" ) ;
17641771
1765- let token = creds_store ( ) . load ( ) . unwrap ( ) . unwrap ( ) ;
1772+ let token = creds_store ( db_name ) . load ( ) . unwrap ( ) . unwrap ( ) ;
17661773
17671774 DbConnection :: builder ( )
17681775 . on_connect ( {
0 commit comments