Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check auth secure on release mode. #4127

Merged
merged 5 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ pub fn read_auth_token(req: &HttpRequest) -> Result<Option<String>, LemmyError>
// ensure that its marked as httponly and secure
let secure = cookie.secure().unwrap_or_default();
let http_only = cookie.http_only().unwrap_or_default();
if !secure || !http_only {
let is_debug_mode = cfg!(debug_assertions);

if !is_debug_mode && (!secure || !http_only) {
Err(LemmyError::from(LemmyErrorType::AuthCookieInsecure))
} else {
Ok(Some(cookie.value().to_string()))
Expand Down
2 changes: 1 addition & 1 deletion crates/apub/src/activities/voting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub(crate) async fn send_like_activity(
score: i16,
context: Data<LemmyContext>,
) -> Result<(), LemmyError> {
let object_id: ObjectId<PostOrComment> = object_id.try_into()?;
let object_id: ObjectId<PostOrComment> = object_id.into();
let actor: ApubPerson = actor.into();
let community: ApubCommunity = community.into();

Expand Down