Skip to content

Commit

Permalink
Merge pull request #3376 from jjlin/knowndevices-nopad
Browse files Browse the repository at this point in the history
Decode knowndevice `X-Request-Email` as base64url with no padding
  • Loading branch information
dani-garcia authored Mar 27, 2023
2 parents 3646f14 + 62cebeb commit 525e6bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/core/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ impl<'r> FromRequest<'r> for KnownDevice {

async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
let email = if let Some(email_b64) = req.headers().get_one("X-Request-Email") {
let email_bytes = match data_encoding::BASE64URL.decode(email_b64.as_bytes()) {
let email_bytes = match data_encoding::BASE64URL_NOPAD.decode(email_b64.as_bytes()) {
Ok(bytes) => bytes,
Err(_) => {
return Outcome::Failure((
Expand Down

0 comments on commit 525e6bb

Please sign in to comment.