Basically I removed all the warnings, removed some old APIs no longer in use, added cert verification to DB, im just cool like that.
This commit is contained in:
parent
c06afde7cb
commit
5a8e61c255
18 changed files with 363 additions and 254 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use chrono::{DateTime, Duration, NaiveDateTime, Utc};
|
||||
use chrono::{Duration, NaiveDateTime, Utc};
|
||||
use rocket::{get, State};
|
||||
use rocket::serde::json::Json;
|
||||
use serde::Serialize;
|
||||
|
|
@ -8,7 +8,7 @@ use crate::nnid::oauth::generate_token::token_type::AUTH_TOKEN;
|
|||
use crate::Pool;
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct TokenData{
|
||||
pub struct TokenData{
|
||||
token: String,
|
||||
expiry: NaiveDateTime
|
||||
}
|
||||
|
|
@ -17,8 +17,6 @@ struct TokenData{
|
|||
pub async fn generate_token(pool: &State<Pool>, auth: Auth<false>) -> Json<TokenData>{
|
||||
let pool = pool.inner();
|
||||
|
||||
|
||||
|
||||
Json(
|
||||
TokenData{
|
||||
expiry: Utc::now().naive_utc() + Duration::hours(1),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use rocket::{get, State};
|
||||
use rocket::serde::json::Json;
|
||||
use serde::de::IntoDeserializer;
|
||||
// use serde::de::IntoDeserializer;
|
||||
use sqlx::query;
|
||||
use crate::account::account::Auth;
|
||||
use crate::nnid::people::{build_profile, GetOwnProfileData};
|
||||
// use crate::account::account::Auth;
|
||||
// use crate::nnid::people::{build_profile, GetOwnProfileData};
|
||||
use crate::Pool;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ use crate::nnid::people::{build_profile, GetOwnProfileData};
|
|||
use crate::Pool;
|
||||
|
||||
#[get("/api/v2/users/@me/profile")]
|
||||
pub async fn get_own_profile(pool: &State<Pool>, auth: Auth<true>) -> Json<GetOwnProfileData> {
|
||||
pub async fn get_own_profile(_pool: &State<Pool>, auth: Auth<true>) -> Json<GetOwnProfileData> {
|
||||
Json(build_profile(auth.into()))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue