mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Restrict new registrations with env setting
This commit is contained in:
parent
b6dc212b4d
commit
1e3a432087
3 changed files with 13 additions and 0 deletions
|
@ -40,6 +40,8 @@ SESSION_SECURE_COOKIE=true
|
||||||
API_BASE="/api/1/"
|
API_BASE="/api/1/"
|
||||||
API_SEARCH="/api/search"
|
API_SEARCH="/api/search"
|
||||||
|
|
||||||
|
OPEN_REGISTRATION=true
|
||||||
|
|
||||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
MIX_APP_URL="${APP_URL}"
|
MIX_APP_URL="${APP_URL}"
|
||||||
|
|
|
@ -39,6 +39,7 @@ class RegisterController extends Controller
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('guest');
|
$this->middleware('guest');
|
||||||
|
$this->openRegistrationCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,4 +84,12 @@ class RegisterController extends Controller
|
||||||
return abort(403);
|
return abort(403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function openRegistrationCheck()
|
||||||
|
{
|
||||||
|
$openRegistration = config('pixelfed.open_registration');
|
||||||
|
if(false == $openRegistration) {
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,6 @@ return [
|
||||||
'use_blacklist' => false
|
'use_blacklist' => false
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'open_registration' => env('OPEN_REGISTRATION', true),
|
||||||
|
|
||||||
];
|
];
|
Loading…
Reference in a new issue