Fixed a bug where authentication yielded incorrect usernames

This commit is contained in:
Antoine Gersant 2018-10-28 15:46:35 -07:00
parent 35514182aa
commit ea299312d0

View file

@ -52,7 +52,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for Auth {
let mut cookies = request.guard::<Cookies>().unwrap(); let mut cookies = request.guard::<Cookies>().unwrap();
match cookies.get_private(SESSION_FIELD_USERNAME) { match cookies.get_private(SESSION_FIELD_USERNAME) {
Some(u) => Outcome::Success(Auth { Some(u) => Outcome::Success(Auth {
username: u.to_string(), username: u.value().to_string(),
}), }),
_ => Outcome::Failure((Status::Forbidden, ())), _ => Outcome::Failure((Status::Forbidden, ())),
} }