Skip to content

Commit

Permalink
Fix login issue (#401)
Browse files Browse the repository at this point in the history
Regression introduced by 4059a84
  • Loading branch information
trinity-1686a authored Dec 31, 2018
1 parent 3128e6a commit 2896eb1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/routes/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ pub fn create(conn: DbConn, form: LenientForm<LoginForm>, flash: Option<FlashMes
let mut err = ValidationError::new("invalid_login");
err.message = Some(Cow::from("Invalid username or password"));
errors.add("email_or_name", err);
user.id.to_string()
} else {
String::new()
} else {
user.id.to_string()
}
} else {
// Fake password verification, only to avoid different login times
Expand All @@ -66,7 +66,6 @@ pub fn create(conn: DbConn, form: LenientForm<LoginForm>, flash: Option<FlashMes
cookies.add_private(Cookie::build(AUTH_COOKIE, user_id)
.same_site(SameSite::Lax)
.finish());

let destination = flash
.and_then(|f| if f.name() == "callback" {
Some(f.msg().to_owned())
Expand Down

0 comments on commit 2896eb1

Please sign in to comment.