Update last_login of user (#26)
All checks were successful
Release Tagging / release (push) Successful in 55s
Rust Build / Check (pull_request) Successful in 58s
Rust Build / Test Suite (pull_request) Successful in 1m3s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Successful in 50s
Rust Build / build (pull_request) Successful in 1m18s
Rust Build / Check (push) Successful in 44s
Rust Build / Test Suite (push) Successful in 57s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 46s
Rust Build / build (push) Successful in 1m11s

Reviewed-on: #26
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
2025-04-11 01:01:18 +00:00
committed by phoenix
parent f6cf968f86
commit 50e735e1a9
2 changed files with 37 additions and 1 deletions

View File

@@ -51,13 +51,16 @@ pub mod endpoint {
let (token_literal, duration) = token_stuff::create_token(&key).unwrap();
if token_stuff::verify_token(&key, &token_literal) {
let current_time = time::OffsetDateTime::now_utc();
let _ = repo::user::update_last_login(&pool, &user, &current_time).await;
(
StatusCode::OK,
Json(response::Response {
message: String::from("Successful"),
data: vec![icarus_models::login_result::LoginResult {
id: user.id,
username: user.username,
username: user.username.clone(),
token: token_literal,
token_type: String::from(token_stuff::TOKENTYPE),
expiration: duration,