Commit e6c53706 authored by Robert Czechowski's avatar Robert Czechowski

Decide which oauth backend to use via new configuration flag 'medal_oauth_type'

parent 1fbb4084
Pipeline #859 failed with stages
in 8 minutes and 11 seconds
......@@ -15,6 +15,7 @@
#[derive(Serialize, Deserialize, Clone, Default, Debug)]
pub struct OauthProvider {
pub provider_id: String,
pub medal_oauth_type: String,
pub url: String,
pub client_id: String,
pub client_secret: String,
......
......@@ -1074,7 +1074,12 @@ fn oauth<C>(req: &mut Request) -> IronResult<Response>
}
};
let user_data = match oauth_pms(req, oauth_provider, school_id.as_ref()).aug(req)? {
let user_data_result = match oauth_provider.medal_oauth_type.as_ref() {
"pms" => oauth_pms(req, oauth_provider, school_id.as_ref()).aug(req)?,
_ => return Ok(Response::with(iron::status::NotFound)),
};
let user_data = match user_data_result {
Err(response) => return Ok(response),
Ok(user_data) => user_data,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment