File tree 2 files changed +6
-2
lines changed
crates/matrix-sdk/src/authentication
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ impl OidcClient {
124
124
pub ( crate ) async fn request_device_authorization (
125
125
& self ,
126
126
device_id : Curve25519PublicKey ,
127
+ extra_scopes : Option < Vec < String > > ,
127
128
) -> Result < CoreDeviceAuthorizationResponse , DeviceAuhorizationOidcError > {
128
129
let scopes = [
129
130
ScopeToken :: Openid ,
@@ -134,7 +135,9 @@ impl OidcClient {
134
135
) ,
135
136
]
136
137
. into_iter ( )
137
- . map ( |scope| Scope :: new ( scope. to_string ( ) ) ) ;
138
+ . map ( |scope| scope. to_string ( ) )
139
+ . chain ( extra_scopes. unwrap_or_default ( ) )
140
+ . map ( Scope :: new) ;
138
141
139
142
let details: CoreDeviceAuthorizationResponse = self
140
143
. inner
Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ impl<'a> IntoFuture for LoginWithQrCode<'a> {
128
128
// Let's tell the OIDC provider that we want to log in using the device
129
129
// authorization grant described in [RFC8628](https://datatracker.ietf.org/doc/html/rfc8628).
130
130
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 ?;
132
133
133
134
// Now we need to inform the other device of the login protocols we picked and
134
135
// the URL they should use to log us in.
You can’t perform that action at this time.
0 commit comments