16 lines
442 B
Rust
16 lines
442 B
Rust
|
//! # User controller
|
||
|
//!
|
||
|
//! The actions of the user on his account when he is authenticated.
|
||
|
|
||
|
use crate::controllers::HttpResult;
|
||
|
use crate::services::login_token_service::LoginToken;
|
||
|
use crate::services::users_service;
|
||
|
use actix_web::HttpResponse;
|
||
|
|
||
|
/// Get account information
|
||
|
pub async fn auth_info(token: LoginToken) -> HttpResult {
|
||
|
let user = users_service::get_by_id(token.user_id).await?;
|
||
|
|
||
|
Ok(HttpResponse::Ok().json(user))
|
||
|
}
|