pub struct AuthUseCases { /* private fields */ }Implementations§
Source§impl AuthUseCases
impl AuthUseCases
pub fn new( user_repo: Arc<dyn UserRepository>, refresh_token_repo: Arc<dyn RefreshTokenRepository>, jwt_secret: String, ) -> Self
pub async fn login( &self, request: LoginRequest, ) -> Result<LoginResponse, String>
pub async fn register( &self, request: RegisterRequest, ) -> Result<LoginResponse, String>
pub async fn get_user_by_id( &self, user_id: Uuid, ) -> Result<UserResponse, String>
pub fn verify_token(&self, token: &str) -> Result<Claims, String>
Sourcepub async fn refresh_token(
&self,
request: RefreshTokenRequest,
) -> Result<LoginResponse, String>
pub async fn refresh_token( &self, request: RefreshTokenRequest, ) -> Result<LoginResponse, String>
Refresh access token using a refresh token
Auto Trait Implementations§
impl Freeze for AuthUseCases
impl !RefUnwindSafe for AuthUseCases
impl Send for AuthUseCases
impl Sync for AuthUseCases
impl Unpin for AuthUseCases
impl !UnwindSafe for AuthUseCases
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more