Skip to main content

aurelin_fortify/
actions.rs

1use std::{error::Error, future::Future};
2
3#[derive(Clone, Debug, PartialEq, Eq)]
4pub struct RegistrationInput {
5    pub name: String,
6    pub email: String,
7    pub password: String,
8}
9
10pub trait CreatesNewUsers: Send + Sync {
11    type User;
12    type Error: Error + Send + Sync + 'static;
13
14    fn create(&self, input: RegistrationInput) -> impl Future<Output = Result<Self::User, Self::Error>> + Send;
15}
16
17#[derive(Clone, Debug, PartialEq, Eq)]
18pub struct ResetPasswordInput {
19    pub email: String,
20    pub password: String,
21}
22
23pub trait ResetsUserPasswords: Send + Sync {
24    type Error: Error + Send + Sync + 'static;
25
26    fn reset(&self, input: ResetPasswordInput) -> impl Future<Output = Result<(), Self::Error>> + Send;
27}