feat(otter): cli command to toggle admin status

This commit is contained in:
Jef Roosens 2025-08-29 14:02:26 +02:00
parent ee9db5ae36
commit b946e1ce98
Signed by: Jef Roosens
GPG key ID: 02D4C0997E74717B
6 changed files with 50 additions and 2 deletions

View file

@ -83,6 +83,10 @@ impl GpodderRepository {
self.store.insert_user(username, &password_hash)
}
pub fn update_user(&self, user: models::User) -> Result<models::User, AuthErr> {
self.store.update_user(user)
}
pub fn validate_credentials(
&self,
username: &str,

View file

@ -51,6 +51,9 @@ pub trait GpodderAuthStore {
/// Insert a new user into the data store
fn insert_user(&self, username: &str, password_hash: &str) -> Result<User, AuthErr>;
/// Update the user with the included ID with the new values
fn update_user(&self, user: User) -> Result<User, AuthErr>;
/// Create a new session for a user with the given session ID
///
/// The `last_seen` timestamp's precision should be at least accurate to the second