Merge branch 'next' into feature/authentik-provider
This commit is contained in:
@@ -5,16 +5,30 @@ namespace App\Providers;
|
||||
use App\Models\PersonalAccessToken;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void {}
|
||||
public function register(): void
|
||||
{
|
||||
if ($this->app->environment('local')) {
|
||||
$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
|
||||
}
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
|
||||
|
||||
Password::defaults(function () {
|
||||
$rule = Password::min(8);
|
||||
|
||||
return $this->app->isProduction()
|
||||
? $rule->mixedCase()->letters()->numbers()->symbols()
|
||||
: $rule;
|
||||
});
|
||||
|
||||
Http::macro('github', function (string $api_url, ?string $github_access_token = null) {
|
||||
if ($github_access_token) {
|
||||
return Http::withHeaders([
|
||||
|
||||
21
app/Providers/DuskServiceProvider.php
Normal file
21
app/Providers/DuskServiceProvider.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class DuskServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register Dusk's browser macros.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
\Laravel\Dusk\Browser::macro('loginWithRootUser', function () {
|
||||
return $this->visit('/login')
|
||||
->type('email', 'test@example.com')
|
||||
->type('password', 'password')
|
||||
->press('Login');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -50,13 +50,10 @@ class FortifyServiceProvider extends ServiceProvider
|
||||
if (! $settings->is_registration_enabled) {
|
||||
return redirect()->route('login');
|
||||
}
|
||||
if (config('coolify.waitlist')) {
|
||||
return redirect()->route('waitlist.index');
|
||||
} else {
|
||||
return view('auth.register', [
|
||||
'isFirstUser' => $isFirstUser,
|
||||
]);
|
||||
}
|
||||
|
||||
return view('auth.register', [
|
||||
'isFirstUser' => $isFirstUser,
|
||||
]);
|
||||
});
|
||||
|
||||
Fortify::loginView(function () {
|
||||
@@ -75,7 +72,8 @@ class FortifyServiceProvider extends ServiceProvider
|
||||
});
|
||||
|
||||
Fortify::authenticateUsing(function (Request $request) {
|
||||
$user = User::where('email', $request->email)->with('teams')->first();
|
||||
$email = strtolower($request->email);
|
||||
$user = User::where('email', $email)->with('teams')->first();
|
||||
if (
|
||||
$user &&
|
||||
Hash::check($request->password, $user->password)
|
||||
|
||||
Reference in New Issue
Block a user