Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
e6c53706
Commit
e6c53706
authored
Oct 09, 2020
by
Robert Czechowski
Browse files
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/oauth_provider.rs
View file @
e6c53706
...
...
@@ -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
,
...
...
src/webfw_iron.rs
View file @
e6c53706
...
...
@@ -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
,
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment