mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-14 20:11:24 +00:00
refactor: session auth public only in crate
This commit is contained in:
parent
05369b977a
commit
3b9bf7cdda
2 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use entity::candidate::Model as Candidate;
|
||||
use portfolio_core::sea_orm::prelude::Uuid;
|
||||
use portfolio_core::services::session_service::SessionService;
|
||||
use portfolio_core::services::candidate_service::CandidateService;
|
||||
use rocket::http::Status;
|
||||
use rocket::outcome::Outcome;
|
||||
use rocket::request::{FromRequest, Request};
|
||||
|
|
@ -27,7 +27,7 @@ impl<'r> FromRequest<'r> for SessionAuth {
|
|||
Err(_) => return Outcome::Failure((Status::BadRequest, None)),
|
||||
};
|
||||
|
||||
let session = SessionService::auth_user_session(conn, uuid).await;
|
||||
let session = CandidateService::auth(conn, uuid).await;
|
||||
|
||||
match session {
|
||||
Ok(model) => Outcome::Success(SessionAuth(model)),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use sea_orm::{DatabaseConnection, prelude::Uuid, ModelTrait};
|
|||
use crate::{crypto::{self}, Query, error::{ServiceError}, Mutation};
|
||||
|
||||
// TODO: generics
|
||||
pub struct SessionService;
|
||||
pub(crate) struct SessionService;
|
||||
|
||||
impl SessionService {
|
||||
/// Delete n old sessions for user
|
||||
|
|
|
|||
Loading…
Reference in a new issue