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
24c715ed
Commit
24c715ed
authored
Aug 18, 2020
by
Robert Czechowski
Browse files
Fix Oauth school selector: Correctly format hash hex bytes
parent
4d325768
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/webfw_iron.rs
View file @
24c715ed
...
...
@@ -1137,12 +1137,13 @@ fn oauth<C>(req: &mut Request) -> IronResult<Response>
println!
(
"{}"
,
string_to_hash
);
hasher
.input
(
string_to_hash
.as_bytes
());
let
hashed_string
=
hasher
.result
();
let
hash
:
String
=
format!
(
"{:X?}"
,
hashed_string
)
.chars
()
let
hash
:
String
=
format!
(
"{:
02
X?}"
,
hashed_string
)
.chars
()
.filter
(|
c
|
c
.is_ascii_alphanumeric
())
.collect
();
println!
(
"{}"
,
hash
);
let
params
=
[(
"schoolId"
,
school_id
.clone
()),
(
"hash"
,
hash
)];
println!
(
"{:?}"
,
params
);
let
res
=
client
.post
(
&
school_data_url
)
.form
(
&
params
)
.send
();
let
school_data
:
OAuthSchoolData
=
res
.expect
(
"network error"
)
.json
()
.expect
(
"malformed json"
);
...
...
Robert Czechowski
@zgtm
mentioned in issue
#91 (closed)
·
Oct 19, 2020
mentioned in issue
#91 (closed)
mentioned in issue #91
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