added friendships in backend

This commit is contained in:
2025-12-18 08:54:18 +01:00
parent 9114a1383b
commit af1b9e4d6d
8 changed files with 226 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
use axum::{
Extension, Json, Router,
extract::Request,
http::{HeaderMap, StatusCode},
http::StatusCode,
middleware::Next,
response::Response,
routing::{get, post},
@@ -11,7 +11,7 @@ use std::env;
use uuid::Uuid;
use validator::ValidateEmail;
use crate::auth::{create_jwt, hash_password, verify_jwt, verify_password};
use crate::auth::{create_jwt, hash_password, validate_token, verify_password};
const DUMMY_HASH: &str = "$argon2id$v=19$m=4096,t=3,p=1$YWFhYWFhYWFhYWFhYWFhYQ$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
@@ -149,10 +149,3 @@ pub async fn register_user(
}),
))
}
async fn validate_token(
headers: HeaderMap,
) -> Result<Json<serde_json::Value>, (StatusCode, String)> {
let _ = verify_jwt(headers)?;
Ok(Json(serde_json::json!({"valid": true})))
}