mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Only check auth secure on release mode. (#4127)
* Only check auth secure on release mode. * Fixing wrong js-client. * Adding is_debug_mode var.
This commit is contained in:
parent
cb01427dcf
commit
98ed0e51cc
@ -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()))
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user