feat(otter): cli command to toggle admin status
This commit is contained in:
parent
ee9db5ae36
commit
b946e1ce98
6 changed files with 50 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue