feat(cli): add command to generate signup links

This commit is contained in:
Jef Roosens 2025-08-28 14:29:00 +02:00
parent 722317603d
commit 4d44216e17
Signed by: Jef Roosens
GPG key ID: 02D4C0997E74717B
4 changed files with 24 additions and 17 deletions

View file

@ -18,7 +18,10 @@ pub enum Command {
#[derive(Subcommand)]
pub enum UserCommand {
/// Add a new user
Add { username: String, password: String },
/// Generate a signup link ID
GenerateSignupLink,
}
impl Command {
@ -59,6 +62,11 @@ impl UserCommand {
Self::Add { username, password } => {
store.create_user(username, password)?;
}
Self::GenerateSignupLink => {
let link = store.generate_signup_link()?;
println!("/signup/{}", link.id);
}
}
Ok(())