Adding is_debug_mode var.

This commit is contained in:
Dessalines 2023-11-06 16:13:53 -05:00
parent e034a05848
commit 39b6fe9acb
2 changed files with 3 additions and 2 deletions

View file

@ -85,8 +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();
let is_debug_mode = cfg!(debug_assertions);
if !cfg!(debug_assertions) && (!secure || !http_only) {
if !is_debug_mode && (!secure || !http_only) {
Err(LemmyError::from(LemmyErrorType::AuthCookieInsecure))
} else {
Ok(Some(cookie.value().to_string()))

View file

@ -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();