feat: allow disabling of registration
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
This commit is contained in:
parent
1cda34d16b
commit
b8cf21903e
3 changed files with 14 additions and 0 deletions
|
@ -67,6 +67,10 @@ pub async fn res(
|
|||
account_information: web::Json<AccountInformation>,
|
||||
data: web::Data<Data>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
if !data.config.instance.registration {
|
||||
return Err(Error::Forbidden("registration is disabled on this instance".to_string()))
|
||||
}
|
||||
|
||||
let uuid = Uuid::now_v7();
|
||||
|
||||
if !EMAIL_REGEX.is_match(&account_information.email) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue