feat(server): add routes for private sign-up links

This commit is contained in:
Jef Roosens 2025-08-28 14:21:26 +02:00
parent 69e84b4266
commit 722317603d
Signed by: Jef Roosens
GPG key ID: 02D4C0997E74717B
4 changed files with 76 additions and 9 deletions

View file

@ -29,9 +29,4 @@ impl<'a> AdminRepository<'a> {
Ok(link)
}
/// Remove the signup link with the given ID, if it exists
pub fn remove_signup_link(&self, id: i64) -> Result<bool, AuthErr> {
self.store.remove_signup_link(id)
}
}

View file

@ -8,7 +8,7 @@ use chrono::{TimeDelta, Utc};
use rand::rngs::OsRng;
use crate::{
models,
SignupLink, models,
store::{AuthErr, GpodderStore},
};
@ -117,4 +117,13 @@ impl GpodderRepository {
self.store.remove_old_sessions(min_last_seen)
}
pub fn get_signup_link(&self, id: i64) -> Result<Option<SignupLink>, AuthErr> {
self.store.get_signup_link(id)
}
/// Remove the signup link with the given ID, if it exists
pub fn remove_signup_link(&self, id: i64) -> Result<bool, AuthErr> {
self.store.remove_signup_link(id)
}
}