mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
Add support for rAuth invite-only mode.
This commit is contained in:
@@ -1,17 +1,2 @@
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
use std::collections::HashSet;
|
||||
use std::iter::FromIterator;
|
||||
|
||||
pub mod result;
|
||||
pub mod variables;
|
||||
|
||||
pub fn vec_to_set<T: Clone + Eq + std::hash::Hash>(data: &[T]) -> HashSet<T> {
|
||||
HashSet::from_iter(data.iter().cloned())
|
||||
}
|
||||
|
||||
pub fn gen_token(l: usize) -> String {
|
||||
rand::thread_rng()
|
||||
.sample_iter(&Alphanumeric)
|
||||
.take(l)
|
||||
.collect::<String>()
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ lazy_static! {
|
||||
|
||||
// Application Flags
|
||||
pub static ref DISABLE_REGISTRATION: bool = env::var("REVOLT_DISABLE_REGISTRATION").map_or(false, |v| v == "1");
|
||||
pub static ref INVITE_ONLY: bool = env::var("REVOLT_INVITE_ONLY").map_or(false, |v| v == "1");
|
||||
pub static ref USE_EMAIL: bool = env::var("REVOLT_USE_EMAIL_VERIFICATION").map_or(
|
||||
env::var("REVOLT_SMTP_HOST").is_ok()
|
||||
&& env::var("REVOLT_SMTP_USERNAME").is_ok()
|
||||
|
||||
Reference in New Issue
Block a user