fix: register page captcha
This commit is contained in:
parent
e5b6b5a4d4
commit
9ba6320d46
3 changed files with 9 additions and 7 deletions
|
@ -103,11 +103,13 @@ impl DataManager {
|
|||
/// # Arguments
|
||||
/// * `data` - a mock [`InviteCode`] object to insert
|
||||
pub async fn create_invite_code(&self, data: InviteCode, user: &User) -> Result<InviteCode> {
|
||||
// check account creation date
|
||||
if unix_epoch_timestamp() - user.created < Self::MINIMUM_ACCOUNT_AGE_FOR_INVITE_CODES {
|
||||
return Err(Error::MiscError(
|
||||
"Your account is too young to do this".to_string(),
|
||||
));
|
||||
// check account creation date (if we aren't a supporter OR this is a purchased account)
|
||||
if !user.permissions.check(FinePermission::SUPPORTER) | user.was_purchased {
|
||||
if unix_epoch_timestamp() - user.created < Self::MINIMUM_ACCOUNT_AGE_FOR_INVITE_CODES {
|
||||
return Err(Error::MiscError(
|
||||
"Your account is too young to do this".to_string(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// ...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue