Trim scopes

This commit is contained in:
Simon Bihel 2022-02-04 12:12:30 +00:00
parent 9355598888
commit 2519f85fd7
No known key found for this signature in database
GPG Key ID: B7013150BEAA28FD

View File

@ -368,7 +368,7 @@ pub async fn authorize(
} }
let _response_type = params.response_type.as_ref().unwrap(); let _response_type = params.response_type.as_ref().unwrap();
for scope in params.scope.as_str().split(' ') { for scope in params.scope.as_str().trim().split(' ') {
if !SCOPES.contains(&Scope::new(scope.to_string())) { if !SCOPES.contains(&Scope::new(scope.to_string())) {
return Err(anyhow!("Scope not supported: {}", scope).into()); return Err(anyhow!("Scope not supported: {}", scope).into());
} }