@@ -214,7 +214,7 @@ mod tests;
214
214
#[ cfg( feature = "e2e-encryption" ) ]
215
215
use self :: cross_process:: { CrossProcessRefreshLockGuard , CrossProcessRefreshManager } ;
216
216
#[ cfg( feature = "e2e-encryption" ) ]
217
- use self :: qrcode:: LoginWithQrCode ;
217
+ use self :: qrcode:: { LoginWithGeneratedQrCode , LoginWithQrCode } ;
218
218
pub use self :: {
219
219
account_management_url:: { AccountManagementActionFull , AccountManagementUrlBuilder } ,
220
220
auth_code_builder:: { OAuthAuthCodeUrlBuilder , OAuthAuthorizationData } ,
@@ -459,6 +459,31 @@ impl OAuth {
459
459
LoginWithQrCode :: new ( & self . client , data, registration_data)
460
460
}
461
461
462
+ /// Log in using a generated QR code.
463
+ ///
464
+ /// This method allows you to log in with a QR code, this device
465
+ /// needs to display the QR code by calling this method so the existing
466
+ /// device can scan it and grant the log in.
467
+ ///
468
+ /// A successful login using this method will automatically mark the device
469
+ /// as verified and transfer all end-to-end encryption related secrets, like
470
+ /// the private cross-signing keys and the backup key from the existing
471
+ /// device to the new device.
472
+ ///
473
+ /// # Arguments
474
+ ///
475
+ /// * `registration_data` - The data to restore or register the client with
476
+ /// the server. If this is not provided, an error will occur unless
477
+ /// [`OAuth::register_client()`] or [`OAuth::restore_registered_client()`]
478
+ /// was called previously.
479
+ #[ cfg( feature = "e2e-encryption" ) ]
480
+ pub fn login_with_generated_qr_code < ' a > (
481
+ & ' a self ,
482
+ registration_data : Option < & ' a ClientRegistrationData > ,
483
+ ) -> LoginWithGeneratedQrCode < ' a > {
484
+ LoginWithGeneratedQrCode :: new ( & self . client , registration_data)
485
+ }
486
+
462
487
/// Restore or register the OAuth 2.0 client for the server with the given
463
488
/// metadata, with the given optional [`ClientRegistrationData`].
464
489
///
0 commit comments