Skip to content

Commit

Permalink
chore: allow login with invalid session token
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
  • Loading branch information
explodingcamera committed Aug 29, 2024
1 parent 3ed6756 commit 34001f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rand::Rng;
use crate::app::models::Event;

const PATHS: &[&str] = &["/", "/about", "/contact", "/pricing", "/blog", "/login", "/signup"];
const REFERRERS: &[&str] = &["", "google.com", "twitter.com", "facebook.com", "github.com"];
const REFERRERS: &[&str] = &["", "google.com", "twitter.com", "liwan.dev", "example.com"];
const PLATFORMS: &[&str] = &["", "Windows", "macOS", "Linux", "Android", "iOS"];
const BROWSERS: &[&str] = &["", "Chrome", "Firefox", "Safari", "Edge", "Opera"];
const CITIES: &[(&str, &str)] = &[
Expand Down
6 changes: 4 additions & 2 deletions src/web/routes/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ impl AuthApi {
&self,
Data(app): Data<&Liwan>,
cookies: &CookieJar,
SessionId(session_id): SessionId,
session_id: Option<SessionId>,
) -> ApiResult<EmptyResponse> {
app.sessions.delete(&session_id).http_status(StatusCode::INTERNAL_SERVER_ERROR)?;
if let Some(session_id) = session_id {
app.sessions.delete(&session_id.0).http_status(StatusCode::INTERNAL_SERVER_ERROR)?;
}
let mut public_cookie = PUBLIC_COOKIE.clone();
let mut session_cookie = SESSION_COOKIE.clone();
public_cookie.set_secure(app.config.secure());
Expand Down

0 comments on commit 34001f7

Please sign in to comment.