From 000213ee507bf3e9bd59703578ff31bc9c169f95 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Sat, 8 May 2021 12:35:28 +0200 Subject: [PATCH] [OAuth] return toke nresponse for password flow --- src/oauth.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oauth.rs b/src/oauth.rs index 392e72e..c5d140b 100644 --- a/src/oauth.rs +++ b/src/oauth.rs @@ -95,7 +95,7 @@ pub fn get_access_token<E: Copy>(conf: Config, prefix: &str, error_value: E, una } } -pub fn get_access_token_password<E: Copy>(conf: Config, prefix: &str, username: String, password: String, error_value: E, unauth_value: E) -> Result<String, E> { +pub fn get_access_token_password<E: Copy>(conf: Config, prefix: &str, username: String, password: String, error_value: E, unauth_value: E) -> Result<BasicTokenResponse, E> { let scopes: Vec<&str> = get_or_error(&conf, &full_key(prefix, "scopes"), error_value)?; let res_username = ResourceOwnerUsername::new(username); @@ -109,7 +109,7 @@ pub fn get_access_token_password<E: Copy>(conf: Config, prefix: &str, username: let result = request.request(http_client); match result { - Ok(t) => Ok("".to_string()), + Ok(t) => Ok(t), Err(e) => match e { RequestTokenError::ServerResponse(t) => { error!("Authorization server returned error: {}", t); -- GitLab