tsk-51: Code cleanup

This commit is contained in:
2025-08-11 18:11:42 -04:00
parent 3985e78c24
commit 3517bbf015
4 changed files with 1 additions and 49 deletions

View File

@@ -154,7 +154,6 @@ pub mod endpoint {
}
}
// TODO: Add endpoint to get a refresh token
pub async fn refresh_token(
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
axum::Json(payload): axum::Json<request::refresh_token::Request>,
@@ -166,15 +165,10 @@ pub mod endpoint {
let key = icarus_envy::environment::get_secret_key().await;
if token_stuff::verify_token(&key, &payload.access_token) {
// * Check token type
// - For right now, just worry about service tokens
// * Create a new token with a longer expiration
let token_type = token_stuff::get_token_type(&key, &payload.access_token).unwrap();
if token_stuff::is_token_type_valid(&token_type) {
// let (token_literal, dur) = token_stuff::create_service_refresh_token(&key, )
// Get passphrase record with id
// match repo::service::get_passphrase
match token_stuff::extract_id_from_token(&key, &payload.access_token) {
Ok(id) => match repo::service::get_passphrase(&pool, &id).await {
Ok((returned_id, _, _)) => {