mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-08-01 10:53:45 +03:00
2026.6.0 send support (#7346)
* 2026.6.0 send support * Prevent creating and editing a Send with email verification * Review fixes --------- Co-authored-by: Timshel <timshel@users.noreply.github.com>
This commit is contained in:
+15
@@ -1,3 +1,8 @@
|
||||
#[path = "auth/send.rs"]
|
||||
pub mod send;
|
||||
pub type SendTokens = send::SendTokens;
|
||||
pub type SendHeaders = send::SendHeaders;
|
||||
|
||||
use std::{
|
||||
env,
|
||||
net::IpAddr,
|
||||
@@ -487,6 +492,16 @@ pub struct BasicJwtClaims {
|
||||
pub sub: String,
|
||||
}
|
||||
|
||||
impl BasicJwtClaims {
|
||||
pub fn expires_in(&self) -> i64 {
|
||||
self.exp - Utc::now().timestamp()
|
||||
}
|
||||
|
||||
pub fn token(&self) -> String {
|
||||
encode_jwt(&self)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn generate_delete_claims(uuid: String) -> BasicJwtClaims {
|
||||
let time_now = Utc::now();
|
||||
let expire_hours = i64::from(CONFIG.invitation_expiration_hours());
|
||||
|
||||
Reference in New Issue
Block a user