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
311b351f
Commit
311b351f
authored
Jan 21, 2021
by
Robert Czechowski
Browse files
Add workaround for PMS OAuth provider giving inconsistently typed school data
parent
c2bfbdfc
Pipeline
#980
passed with stages
in 17 minutes and 19 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/webfw_iron.rs
View file @
311b351f
...
...
@@ -1250,6 +1250,15 @@ fn oauth_pms(req: &mut Request, oauth_provider: OauthProvider, school_id: Option
// Unify ambiguous fields
user_data
.userId
=
user_data
.userID
.or
(
user_data
.userId
);
// Workaround for PMS:
if
user_data
.userType
==
"t"
||
user_data
.userType
==
"T"
{
if
let
Some
(
SchoolIdOrSchoolIds
::
SchoolId
(
school_id
))
=
user_data
.schoolId
{
let
mut
v
=
Vec
::
new
();
v
.push
(
school_id
);
user_data
.schoolId
=
Some
(
SchoolIdOrSchoolIds
::
SchoolIds
(
v
));
}
}
// Does the user has an array of school (i.e. is he a teacher)?
if
let
Some
(
SchoolIdOrSchoolIds
::
SchoolIds
(
school_ids
))
=
user_data
.schoolId
{
// Has there been a school selected?
...
...
Robert Czechowski
@zgtm
mentioned in commit
0a98662c
·
Feb 02, 2021
mentioned in commit
0a98662c
mentioned in commit 0a98662cff19472ca4039653c37d561688056825
Toggle commit list
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