Files
gitks/service/auth/mod.rs
T
zhenyi 420dedbc1e feat(service): expand service layer with new domain operations
- Add IM service modules: audit, channel roles, custom emojis, forum
  tags, integrations, invitations, repo links, slash commands, stages,
  voice, webhooks
- Add PR service modules: review requests, templates
- Add repo service modules: contributors, release assets, git extras
  (archive, branch rename, commit extras, diff/merge, tag, tree)
- Add user service: social (follow/block)
- Add internal auth service
- Update existing service modules with expanded functionality
- Remove deleted IM modules: articles, delivery trace, drafts,
  follows, messages, polls, presence, reactions, threads
2026-06-10 18:49:32 +08:00

27 lines
650 B
Rust

pub mod captcha;
pub mod change_password;
pub mod email;
pub mod login;
pub mod logout;
pub mod me;
pub mod register;
pub mod reset_pass;
pub mod rsa;
pub mod totp;
pub(crate) fn generate_token(prefix: &str) -> String {
let mut rng = rand::thread_rng();
use rand::Rng;
let chars: String = (0..64)
.map(|_| {
let idx = rng.gen_range(0..62);
const CHARSET: &[u8] =
b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
CHARSET[idx] as char
})
.collect();
format!("{}_{}", prefix, chars)
}
// constant_time_eq is provided by crate::service::util