kopia lustrzana https://github.com/pixelfed/pixelfed
				
				
				
			Restrict new registrations with env setting
							rodzic
							
								
									b6dc212b4d
								
							
						
					
					
						commit
						1e3a432087
					
				|  | @ -40,6 +40,8 @@ SESSION_SECURE_COOKIE=true | |||
| API_BASE="/api/1/" | ||||
| API_SEARCH="/api/search" | ||||
| 
 | ||||
| OPEN_REGISTRATION=true | ||||
| 
 | ||||
| MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||||
| MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" | ||||
| MIX_APP_URL="${APP_URL}" | ||||
|  |  | |||
|  | @ -39,6 +39,7 @@ class RegisterController extends Controller | |||
|     public function __construct() | ||||
|     { | ||||
|         $this->middleware('guest'); | ||||
|         $this->openRegistrationCheck(); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | @ -83,4 +84,12 @@ class RegisterController extends Controller | |||
|             return abort(403); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public function openRegistrationCheck() | ||||
|     { | ||||
|         $openRegistration = config('pixelfed.open_registration'); | ||||
|         if(false == $openRegistration) { | ||||
|             abort(403); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -15,4 +15,6 @@ return [ | |||
|     'use_blacklist' => false | ||||
|   ], | ||||
|    | ||||
|   'open_registration' => env('OPEN_REGISTRATION', true), | ||||
|    | ||||
| ]; | ||||
		Ładowanie…
	
		Reference in New Issue
	
	 Daniel Supernault
						Daniel Supernault