mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 18:12:27 +00:00
AppToken add creation date
This commit is contained in:
@@ -111,6 +111,7 @@ impl AuthenticationProvider for TomlPrincipalStore {
|
||||
principal.app_tokens.push(AppToken {
|
||||
name,
|
||||
token: token_hash,
|
||||
created_at: Some(chrono::Utc::now()),
|
||||
});
|
||||
self.save(principals.deref())?;
|
||||
Ok(())
|
||||
|
||||
@@ -3,6 +3,7 @@ use actix_web::{
|
||||
http::{header, StatusCode},
|
||||
FromRequest, HttpMessage, HttpResponse, ResponseError,
|
||||
};
|
||||
use chrono::{DateTime, Utc};
|
||||
use derive_more::Display;
|
||||
use rustical_xml::ValueSerialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -38,6 +39,7 @@ impl ValueSerialize for PrincipalType {
|
||||
pub struct AppToken {
|
||||
pub name: String,
|
||||
pub token: String,
|
||||
pub created_at: Option<DateTime<Utc>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user