File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
crates/matrix-sdk/src/authentication Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -124,17 +124,19 @@ impl OidcClient {
124124 pub ( crate ) async fn request_device_authorization (
125125 & self ,
126126 device_id : Curve25519PublicKey ,
127+ custom_scopes : Option < Vec < ScopeToken > > ,
127128 ) -> Result < CoreDeviceAuthorizationResponse , DeviceAuhorizationOidcError > {
128- let scopes = [
129- ScopeToken :: Openid ,
130- ScopeToken :: MatrixApi ( MatrixApiScopeToken :: Full ) ,
131- ScopeToken :: try_with_matrix_device ( device_id. to_base64 ( ) ) . expect (
132- "We should be able to create a scope token from a \
129+ let scopes = custom_scopes
130+ . unwrap_or ( vec ! [
131+ ScopeToken :: Openid ,
132+ ScopeToken :: MatrixApi ( MatrixApiScopeToken :: Full ) ,
133+ ScopeToken :: try_with_matrix_device( device_id. to_base64( ) ) . expect(
134+ "We should be able to create a scope token from a \
133135 Curve25519 public key encoded as base64",
134- ) ,
135- ]
136- . into_iter ( )
137- . map ( |scope| Scope :: new ( scope. to_string ( ) ) ) ;
136+ ) ,
137+ ] )
138+ . into_iter ( )
139+ . map ( |scope| Scope :: new ( scope. to_string ( ) ) ) ;
138140
139141 let details: CoreDeviceAuthorizationResponse = self
140142 . inner
Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ impl<'a> IntoFuture for LoginWithQrCode<'a> {
128128 // Let's tell the OIDC provider that we want to log in using the device
129129 // authorization grant described in [RFC8628](https://datatracker.ietf.org/doc/html/rfc8628).
130130 trace ! ( "Requesting device authorization." ) ;
131- let auth_grant_response = oidc_client. request_device_authorization ( device_id) . await ?;
131+ let auth_grant_response =
132+ oidc_client. request_device_authorization ( device_id, None ) . await ?;
132133
133134 // Now we need to inform the other device of the login protocols we picked and
134135 // the URL they should use to log us in.
You can’t perform that action at this time.
0 commit comments