summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/auth/cookie.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/auth/cookie.rs b/src/modules/auth/cookie.rs
index fbc54c8..de4c76f 100644
--- a/src/modules/auth/cookie.rs
+++ b/src/modules/auth/cookie.rs
@@ -81,7 +81,7 @@ impl Node for CookieAuth {
if self.users.authentificate(username, password) {
debug!("login success");
let nonce = [(); 12].map(|_| random::<u8>());
- let plaintext = unix_seconds().to_le_bytes();
+ let plaintext = unix_seconds().to_be_bytes();
let mut ciphertext = context
.state
.crypto_key
@@ -146,7 +146,7 @@ impl Node for CookieAuth {
},
);
if let Ok(plaintext) = plaintext {
- let created = u64::from_le_bytes(plaintext[0..8].try_into().unwrap());
+ let created = u64::from_be_bytes(plaintext[0..8].try_into().unwrap());
if self
.expire