Added serde renaming to fields that need it in token

This commit is contained in:
Franklin 2022-08-27 11:42:43 -04:00
parent 62c1937f11
commit 27fcb01ede
1 changed files with 3 additions and 0 deletions

View File

@ -8,12 +8,15 @@ pub const REFRESH_TOKEN_EXPIRATION_TIME_IN_DAYS: i32 = 20;
pub struct Token {
#[serde(skip_serializing, skip_deserializing)]
pub id: i32,
#[serde(rename = "userId")]
pub user_id: i32,
#[serde(skip_serializing, skip_deserializing)]
pub time_created: Option<NaiveDateTime>,
#[serde(skip_serializing, skip_deserializing)]
pub last_updated: Option<NaiveDateTime>,
#[serde(rename = "authToken")]
pub auth_token: String,
#[serde(rename = "refreshToken")]
pub refresh_token: String
}