mirror of
https://github.com/atuinsh/atuin.git
synced 2025-08-15 01:32:51 +02:00
feat: add user account verification (#2190)
* add verified column to users table * add database functions to check if verified, or to verify * getting there * verification check * use base64 urlsafe no pad * add verification client * clippy * correct docs * fix integration tests
This commit is contained in:
@ -53,6 +53,11 @@ pub trait Database: Sized + Clone + Send + Sync + 'static {
|
||||
async fn get_user(&self, username: &str) -> DbResult<User>;
|
||||
async fn get_user_session(&self, u: &User) -> DbResult<Session>;
|
||||
async fn add_user(&self, user: &NewUser) -> DbResult<i64>;
|
||||
|
||||
async fn user_verified(&self, id: i64) -> DbResult<bool>;
|
||||
async fn verify_user(&self, id: i64) -> DbResult<()>;
|
||||
async fn user_verification_token(&self, id: i64) -> DbResult<String>;
|
||||
|
||||
async fn update_user_password(&self, u: &User) -> DbResult<()>;
|
||||
|
||||
async fn total_history(&self) -> DbResult<i64>;
|
||||
|
@ -32,6 +32,7 @@ pub struct User {
|
||||
pub username: String,
|
||||
pub email: String,
|
||||
pub password: String,
|
||||
pub verified: Option<OffsetDateTime>,
|
||||
}
|
||||
|
||||
pub struct Session {
|
||||
|
Reference in New Issue
Block a user