mirror of
https://github.com/nullishamy/ferri.git
synced 2025-06-28 09:04:18 +00:00
feat: auth basics
This commit is contained in:
parent
005c13e1d4
commit
9c7c2858cc
11 changed files with 215 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::{Db, endpoints::api::user::CredentialAcount};
|
||||
use crate::{AuthenticatedUser, Db, endpoints::api::user::CredentialAcount};
|
||||
use rocket::{
|
||||
get,
|
||||
serde::{Deserialize, Serialize, json::Json},
|
||||
|
@ -32,7 +32,12 @@ pub struct TimelineStatus {
|
|||
}
|
||||
|
||||
#[get("/timelines/home?<limit>")]
|
||||
pub async fn home(mut db: Connection<Db>, limit: i64) -> Json<Vec<TimelineStatus>> {
|
||||
pub async fn home(
|
||||
mut db: Connection<Db>,
|
||||
limit: i64,
|
||||
user: AuthenticatedUser,
|
||||
) -> Json<Vec<TimelineStatus>> {
|
||||
dbg!(user);
|
||||
let posts = sqlx::query!(
|
||||
r#"
|
||||
SELECT p.id as "post_id", u.id as "user_id", p.content, p.uri as "post_uri",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue