An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
Fixed OAuth signin bug, ignoring the 'Allow Registration'-setting and registers a new user, even when the setting is disabled
Kenneth Thomsenb5be17c2d284
diff --git a/app/Http/Controllers/OauthController.php b/app/Http/Controllers/OauthController.phpindex 5b17fe9265..9569e8cfa4 100644--- a/app/Http/Controllers/OauthController.php+++ b/app/Http/Controllers/OauthController.php@@ -2,8 +2,10 @@namespace App\Http\Controllers;+use App\Models\InstanceSettings;use App\Models\User;use Illuminate\Support\Facades\Auth;+use Symfony\Component\HttpKernel\Exception\HttpException;class OauthController extends Controller{@@ -20,6 +22,11 @@ class OauthController extends Controller$oauthUser = get_socialite_provider($provider)->user();$user = User::whereEmail($oauthUser->email)->first();if (! $user) {+ $settings = InstanceSettings::get();+ if (! $settings->is_registration_enabled) {+ abort(403, 'Registration is disabled');+ }+$user = User::create(['name' => $oauthUser->name,'email' => $oauthUser->email,@@ -31,7 +38,9 @@ class OauthController extends Controller} catch (\Exception $e) {ray($e->getMessage());- return redirect()->route('login')->withErrors([__('auth.failed.callback')]);+ $errorCode = $e instanceof HttpException ? 'auth.failed' : 'auth.failed.callback';++ return redirect()->route('login')->withErrors([__($errorCode)]);}}}