feat: Add public routes for hackathons and enhance permissions checks to support both names and IDs

This commit is contained in:
MythEclipse
2025-10-05 20:23:34 +07:00
parent b27e4a4404
commit 7749f6fdec
6 changed files with 74 additions and 10 deletions
+19
View File
@@ -0,0 +1,19 @@
use imphnen_libs::jsonwebtoken::encode_access_token;
use std::env;
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
eprintln!("Usage: mk_token <email_or_sub>");
std::process::exit(1);
}
let sub = args[1].clone();
// Use sub as both sub and user_id
match encode_access_token(sub.clone(), sub.clone()) {
Ok(token) => println!("{}", token),
Err(e) => {
eprintln!("Failed to generate token: {:?}", e);
std::process::exit(2);
}
}
}