passwordless login + proper migrations
ci/woodpecker/push/e2e Pipeline was successful
ci/woodpecker/push/fmt Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2026-08-03 00:23:10 -04:00
parent 1291c5a33a
commit 209363774c
14 changed files with 753 additions and 188 deletions
+5 -3
View File
@@ -37,12 +37,14 @@ pub struct RandomTokenGenerator;
#[async_trait]
impl TokenGenerator for RandomTokenGenerator {
fn generate(&self) -> String {
new_secret()
hex::encode(new_secret())
}
}
pub fn new_secret() -> String {
/// Generates 32 cryptographically random bytes. Callers that need a
/// client-facing string should hex-encode the result.
pub fn new_secret() -> Vec<u8> {
let mut bytes = [0_u8; 32];
OsRng.fill_bytes(&mut bytes);
hex::encode(bytes)
bytes.to_vec()
}