File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
crates/matrix-sdk/src/authentication Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -124,15 +124,16 @@ impl OidcClient {
124
124
pub ( crate ) async fn request_device_authorization (
125
125
& self ,
126
126
device_id : Curve25519PublicKey ,
127
+ custom_scopes : Option < Vec < ScopeToken > > ,
127
128
) -> Result < CoreDeviceAuthorizationResponse , DeviceAuhorizationOidcError > {
128
- let scopes = [
129
+ let scopes = custom_scopes . unwrap_or ( vec ! [
129
130
ScopeToken :: Openid ,
130
131
ScopeToken :: MatrixApi ( MatrixApiScopeToken :: Full ) ,
131
132
ScopeToken :: try_with_matrix_device( device_id. to_base64( ) ) . expect(
132
133
"We should be able to create a scope token from a \
133
134
Curve25519 public key encoded as base64",
134
135
) ,
135
- ]
136
+ ] )
136
137
. into_iter ( )
137
138
. map ( |scope| Scope :: new ( scope. to_string ( ) ) ) ;
138
139
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