AppToken add creation date

This commit is contained in:
Lennart
2025-02-10 15:20:01 +01:00
parent 23007a3bda
commit 7e8a246084
2 changed files with 3 additions and 0 deletions

View File

@@ -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(())

View File

@@ -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)]