Compare commits

..

62 Commits

Author SHA1 Message Date
philipp lang 74d42d7496 Fix error handling for mailgateway forms
continuous-integration/drone/push Build is failing Details
2024-11-18 23:11:37 +01:00
philipp lang 81a546108b Add error handling via tooltip 2024-11-18 23:11:37 +01:00
philipp lang 05b41eabb8 Fix: Add id to select field 2024-11-18 23:11:37 +01:00
philipp lang 013aa082ec Add Vite facade 2024-11-18 23:11:37 +01:00
philipp lang b69b85cc4f Add Danger theme for tippy 2024-11-18 23:11:37 +01:00
philipp lang d9263d7534 Add vite spritemap 2024-11-18 23:11:37 +01:00
philipp lang 3164b1c436 Update sprite component 2024-11-18 23:11:37 +01:00
philipp lang da3b8ac72c Add validation attributes to nami field 2024-11-18 23:11:37 +01:00
philipp lang 013353f4a8 Add SettingIntro component 2024-11-18 23:11:37 +01:00
philipp lang 35b28a218e Add Nami Settings 2024-11-18 23:11:37 +01:00
philipp lang f6b1c5a45f Move test files 2024-11-18 23:11:37 +01:00
philipp lang 66f5b1311e Add page title 2024-11-18 23:11:37 +01:00
philipp lang 1029d22117 Add active menu entry for setting 2024-11-18 23:11:37 +01:00
philipp lang d885699fc9 Set active title for setting 2024-11-18 23:11:37 +01:00
philipp lang efdce00ad0 Update arch tests 2024-11-18 23:11:37 +01:00
philipp lang 13a7fe1f36 Lint 2024-11-18 23:11:37 +01:00
philipp lang 95e1a98b8e Move types 2024-11-18 23:11:37 +01:00
philipp lang 5f511534c3 Move modules 2024-11-18 23:11:37 +01:00
philipp lang c3512ca558 Add Badge component 2024-11-18 23:11:37 +01:00
philipp lang c3a9ae8fa0 Add data type cast for Mailgateway 2024-11-18 23:11:37 +01:00
philipp lang df8b82119e Allow MailmanTypeRequest to cast to data 2024-11-18 23:11:37 +01:00
philipp lang 092227d1e8 Mod setArray macro for nested values 2024-11-18 23:11:37 +01:00
philipp lang 396563e6e1 Simplify form 2024-11-18 23:11:37 +01:00
philipp lang 3acd3d850b Update update hook 2024-11-18 23:11:37 +01:00
philipp lang e46b65b6cc Add test for events 2024-11-18 23:11:37 +01:00
philipp lang 803c916e7a Lint 2024-11-18 23:11:37 +01:00
philipp lang ef16176b63 Update refresh page 2024-11-18 23:11:37 +01:00
philipp lang 6188a8de4e Add mailgateway 2024-11-18 23:11:37 +01:00
philipp lang 716f7e695a Fix layout 2024-11-18 23:11:37 +01:00
philipp lang 0a7c3de1d7 Remove old MailgatewayRequestFactory 2024-11-18 23:11:37 +01:00
philipp lang 2d34452f26 Lint 2024-11-18 23:11:37 +01:00
philipp lang 421933b42e Add HTTP Check to MailmanTypeRequest 2024-11-18 23:11:37 +01:00
philipp lang 8ece5fd8c5 Delete old mailgateway tests 2024-11-18 23:11:37 +01:00
philipp lang 7b71ecf3d8 Mark MailgatewayResource as deprecated 2024-11-18 23:11:37 +01:00
philipp lang 6ce8265787 Mark old mailgateway settings as deprecated 2024-11-18 23:11:37 +01:00
philipp lang 3337c663da Add BooleanDisplay component 2024-11-18 23:11:37 +01:00
philipp lang 7304436163 Make right slot optional in SettingLayout 2024-11-18 23:11:37 +01:00
philipp lang 527f13460c fixup! Add modal component 2024-11-18 23:11:37 +01:00
philipp lang aca133abe5 Add testable macro for setArray 2024-11-18 23:11:37 +01:00
philipp lang 6f22b8ae2e Add modal component 2024-11-18 23:11:37 +01:00
philipp lang ebdc3d7785 Throw exception when variant not found 2024-11-18 23:11:37 +01:00
philipp lang 2831795a6b Lint 2024-11-18 23:11:37 +01:00
philipp lang 12e34301ec Merge attributes for hint 2024-11-18 23:11:37 +01:00
philipp lang f70ad7aa9e Lint 2024-11-18 23:11:37 +01:00
philipp lang 5453755f09 Fix Tooltip attribute of Table action 2024-11-18 23:11:37 +01:00
philipp lang 908ed28123 Register MailgatewayServiceProvider 2024-11-18 23:11:37 +01:00
philipp lang c1130bc061 Add select field 2024-11-18 23:11:37 +01:00
philipp lang 0dea02ded4 Disable autocomplete for password fields 2024-11-18 23:11:37 +01:00
philipp lang 501e786fb9 Fix label required 2024-11-18 23:11:37 +01:00
philipp lang 845f646dd4 Add Table action button 2024-11-18 23:11:37 +01:00
philipp lang d469dbfa75 Add table component 2024-11-18 23:11:37 +01:00
philipp lang fdc2b43bde Mod Component Test 2024-11-18 23:11:37 +01:00
philipp lang 386d644c8e Move Dashboard registrations 2024-11-18 23:11:37 +01:00
philipp lang a6606ee0ed Add Settings for Bill 2024-11-18 23:11:37 +01:00
philipp lang fee3829ca7 Add Toast and tooltip 2024-11-18 23:11:37 +01:00
philipp lang 37d028e718 Remove Base tests from Composer 2024-11-18 23:11:37 +01:00
philipp lang 2c7a243da3 Add Component Resolver for Modules 2024-11-18 23:11:37 +01:00
philipp lang 1e5e13f85e Add Dashboard 2024-11-18 23:11:37 +01:00
philipp lang ee75bdae63 Add Service Provider 2024-11-18 23:11:37 +01:00
philipp lang d80f221af9 Add livewire components 2024-11-18 23:11:37 +01:00
philipp lang 720b493df6 Add config file 2024-11-18 23:11:37 +01:00
philipp lang 11be110a57 Install Livewire Package 2024-11-18 23:11:37 +01:00
29 changed files with 287 additions and 394 deletions

View File

@ -1,9 +1,5 @@
# Letzte Änderungen
### 1.11.4
- Fix: Nicht an Präventions-Unterlagen für vergangene Veranstaltungen erinnern
### 1.11.1
- Es kann nun auch das Feld "Datenweiterverwendung" über Adrema gepflegt werden.

View File

@ -1,6 +1,6 @@
<?php
namespace Modules\Auth\Mails;
namespace App\Auth;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Facades\Lang;
@ -17,7 +17,7 @@ class ResetPassword extends BaseResetPassword
protected function buildMailMessage($url)
{
return (new MailMessage)
->subject(Lang::get('Passwort zurücksetzen | ' . config('app.name')))
->subject(Lang::get('Passwort zurücksetzen | Adrema'))
->line(Lang::get('Du erhälst diese E-Mail, weil du eine Anfrage zum zurücksetzen deines Account-Passworts gestellt hast.'))
->action(Lang::get('Passwort zurücksetzen'), $url)
->line(Lang::get('Dieser Link wird in :count Minuten ablaufen.', ['count' => config('auth.passwords.' . config('auth.defaults.passwords') . '.expire')]))

View File

@ -17,12 +17,7 @@ class PreventionRememberAction
public function handle(): void
{
$query = Participant::whereHas(
'form',
fn ($form) => $form
->where('needs_prevention', true)
->where('from', '>=', now())
)
$query = Participant::whereHas('form', fn ($form) => $form->where('needs_prevention', true))
->where(
fn ($q) => $q
->where('last_remembered_at', '<=', now()->subWeeks(2))

View File

@ -0,0 +1,60 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Inertia\Response;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
public function showLoginForm(): Response
{
session()->put('title', 'Anmelden');
return \Inertia::render('authentication/VLogin');
}
/**
* Validate the user login request.
*/
protected function validateLogin(Request $request): void
{
$request->validate([
$this->username() => 'required|max:255|string|email',
'password' => 'required|string',
]);
}
}

View File

@ -0,0 +1,71 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
}

View File

@ -2,11 +2,11 @@
namespace App;
use App\Auth\ResetPassword;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Modules\Auth\Mails\ResetPassword;
class User extends Authenticatable
{

View File

@ -1,32 +0,0 @@
<?php
namespace App\View\Page;
use Illuminate\View\Component;
class Full extends Component
{
public function __construct(public string $title = '', public ?string $heading = null)
{
session()->put('title', $title);
}
public function render()
{
return <<<'HTML'
<div class="min-w-[16rem] sm:min-w-[18rem] md:min-w-[24rem] bg-gray-800 rounded-xl overflow-hidden shadow-lg @if($heading === null) p-6 md:p-10 @endif">
@if ($heading)
<div class="h-24 p-6 md:px-10 bg-primary-800 flex justify-between items-center w-full">
<span class="text-primary-500 text-xl">{{$heading}}</span>
<img src="{{asset('img/dpsg.gif')}}" class="w-24" />
</div>
@endif
<div @if($heading !== null) class="p-6 md:p-10" @endif>
{{ $slot }}
</div>
</div>
HTML;
}
}

View File

@ -7,10 +7,9 @@ use Illuminate\View\Component;
class Layout extends Component
{
public function __construct(public string $pageClass = '', public string $title = '', public string $menu = '')
public function __construct(public string $pageClass = '', public string $title = '')
{
session()->put('title', $title);
session()->put('menu', $menu);
}
public function userName(): string

View File

@ -18,12 +18,13 @@ class SettingLayout extends Component
'is_active' => get_class($setting) === $active,
'title' => $setting->title(),
])->toArray();
session()->put('menu', 'setting');
}
public function render()
{
return <<<'HTML'
<x-page::layout :title="$active::title()" menu="setting">
<x-page::layout :title="$active::title()">
<x-slot:right>
{{ $right ?? '' }}
</x-slot:right>

View File

@ -1,22 +0,0 @@
<?php
namespace App\View\Ui;
use Illuminate\View\Component;
class Button extends Component
{
public function __construct(public string $type = 'button')
{
}
public function render()
{
return <<<'HTML'
<button type="{{$type}}" class="px-3 py-2 uppercase no-underline text-sm items-center justify-center bg-primary-700 rounded text-primary-300">
{{$slot}}
</button>
HTML;
}
}

View File

@ -183,7 +183,6 @@ return [
Modules\Invoice\InvoiceServiceProvider::class,
Modules\Mailgateway\MailgatewayServiceProvider::class,
Modules\Nami\NamiServiceProvider::class,
Modules\Auth\AuthServiceProvider::class,
],
/*

View File

@ -27,9 +27,4 @@ class UserFactory extends Factory
'lastname' => $this->faker->lastName,
];
}
public function loginData(string $email, string $password): self
{
return $this->state(['email' => $email, 'password' => Hash::make($password)]);
}
}

View File

@ -1,34 +0,0 @@
<?php
namespace Modules\Auth;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Modules\Auth\Components\LoginForm;
use Modules\Auth\Components\PasswordReset;
class AuthServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
app(Router::class)->middleware(['web', 'guest'])->group(function ($router) {
$router->get('/login', LoginForm::class)->name('login');
$router->get('/password/reset', PasswordReset::class)->name('password.request');
$router->get('/password/reseta', PasswordReset::class)->name('password.reset');
});
}
}

View File

@ -1,62 +0,0 @@
<?php
namespace Modules\Auth\Components;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Layout;
use Livewire\Component;
class LoginForm extends Component
{
use AuthenticatesUsers;
use ThrottlesLogins;
public string $email = '';
public string $password = '';
public function validateLogin(Request $request)
{
$this->validate([
'email' => 'required|max:255|string|email',
'password' => 'required|string',
]);
}
protected function credentials(Request $request)
{
return ['email' => $this->email, 'password' => $this->password];
}
protected function sendLoginResponse(Request $request)
{
return redirect()->intended('/');
}
public function submit()
{
return $this->login(request());
}
#[Layout('components.layouts.full')]
public function render(): string
{
return <<<'HTML'
<x-page::full heading="Login" title="Login">
<form wire:submit="submit">
<div class="grid gap-5">
<x-form::text name="email" wire:model="email" label="E-Mail-Adresse"></x-form::text>
<x-form::text name="password" wire:model="password" type="password" label="Passwort"></x-form::text>
<x-ui::button type="submit">Login</x-ui::button>
<div class="flex justify-center">
<a href="{{route('password.request')}}" class="text-gray-500 text-sm hover:text-gray-300">Passwort vergessen?</a>
</div>
</div>
</form>
</x-page::full>
HTML;
}
}

View File

@ -1,70 +0,0 @@
<?php
namespace Modules\Auth\Components;
use App\User;
use Illuminate\Auth\Events\Lockout;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Event;
use Livewire\Livewire;
uses(TestCase::class);
uses(DatabaseTransactions::class);
it('redirects to login', function () {
test()->get('/')->assertRedirect('/login');
});
it('displays component', function () {
test()->get('/login')->assertSeeLivewire(LoginForm::class)->assertDontSee('Dashboard');
});
it('displays form', function () {
Livewire::test(LoginForm::class)
->assertSee('Login')
->assertSee('Passwort vergessen')
->assertSee(route('password.request'));
});
it('loggs in', function () {
User::factory()->loginData('admin@example.com', 'secret')->create();
Livewire::test(LoginForm::class)
->set('email', 'admin@example.com')
->set('password', 'secret')
->call('submit')
->assertRedirect('/');
$this->assertEquals('admin@example.com', auth()->user()->email);
});
it('displays failed login response', function () {
Livewire::test(LoginForm::class)
->set('email', 'admin@example.com')
->set('password', 'secret')
->call('submit')
->assertHasErrors(['email' => 'Login fehlgeschlagen.']);
});
it('increments login attempts', function () {
Event::fake([Lockout::class]);
Livewire::test(LoginForm::class)
->set('email', 'admin@example.com')
->set('password', 'secret')
->call('submit')
->call('submit')
->call('submit')
->call('submit')
->call('submit')
->call('submit');
Event::assertDispatchedTimes(Lockout::class);
});
it('requires email and password', function () {
User::factory()->loginData('admin@example.com', 'secret')->create();
Livewire::test(LoginForm::class)
->set('email', '')
->set('password', '')
->call('submit')
->assertHasErrors(['email', 'password']);
});

View File

@ -1,66 +0,0 @@
<?php
namespace Modules\Auth\Components;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Layout;
use Livewire\Component;
class PasswordReset extends Component
{
use SendsPasswordResetEmails;
public string $email = '';
protected function validateEmail(Request $request)
{
$this->validate([
'email' => 'required|max:255|string|email',
]);
}
protected function sendResetLinkFailedResponse(Request $request, $response)
{
throw ValidationException::withMessages([
'email' => [trans($response)],
]);
}
protected function credentials(Request $request)
{
return ['email' => $this->email];
}
public function submit()
{
$this->sendResetLinkEmail(request());
$this->dispatch('success', 'Du hast weitere Instruktionen per E-Mail erhalten.');
}
#[Layout('components.layouts.full')]
public function render(): string
{
return <<<'HTML'
<x-page::full heading="Passwort vergessen" title="Passwort vergessen">
<form wire:submit.prevent="submit">
<div class="grid gap-5">
<span class="text-gray-500 text-sm"
>Hier kannst du dein Passwort zurücksetzen.<br />
Gebe dafür die E-Mail-Adresse deines Benutzerkontos ein.<br />
Anschließend bekommst du eine E-Mail<br />
mit weiteren Anweisungen.</span
>
<x-form::text name="email" wire:model="email" label="E-Mail-Adresse"></x-form::text>
<x-ui::button type="submit">Passwort zurücksetzen</x-ui::button>
<div class="flex justify-center">
<a href="/login" class="text-gray-500 text-sm hover:text-gray-300">Zurück zum Login</a>
</div>
</div>
</form>
</x-page::full>
HTML;
}
}

View File

@ -1,50 +0,0 @@
<?php
namespace Modules\Auth\Components;
use Modules\Auth\Mails\ResetPassword;
use App\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Notification;
use Livewire\Livewire;
uses(TestCase::class);
uses(DatabaseTransactions::class);
it('displays component', function () {
test()->get(route('password.request'))->assertSeeLivewire(PasswordReset::class)->assertDontSee('Dashboard');
});
it('shows intro', function () {
Livewire::test(PasswordReset::class)->assertSee('Hier kannst du dein Passwort zurücksetzen.');
});
it('it needs email address', function (string $email, string $error) {
Livewire::test(PasswordReset::class)
->set('email', $email)
->call('submit')
->assertHasErrors(['email' => $error]);
})
->with([
['', 'E-Mail Adresse ist erforderlich.'],
['aaa', 'E-Mail Adresse muss eine gültige E-Mail-Adresse sein.'],
]);
it('displays error when user doesnt exsst', function () {
Livewire::test(PasswordReset::class)
->set('email', 'nowhere@example.com')
->call('submit')
->assertHasErrors(['email' => 'Es konnte leider kein Nutzer mit dieser E-Mail-Adresse gefunden werden.']);
});
it('requests link', function () {
Notification::fake();
$user = User::factory()->loginData('admin@example.com', 'secret')->create();
Livewire::test(PasswordReset::class)
->set('email', 'admin@example.com')
->call('submit')
->assertDispatched('success', 'Du hast weitere Instruktionen per E-Mail erhalten.');
Notification::assertSentTo($user, ResetPassword::class);
});

View File

@ -12,13 +12,16 @@ class DashboardComponent extends Component
public function mount(DashboardFactory $factory): void
{
session()->put('menu', 'dashboard');
session()->put('title', 'Dashboard');
$this->blocks = $factory->load();
}
public function render(): string
{
return <<<'HTML'
<x-page::layout title="Dashboard" menu="dashboard">
<x-page::layout>
<div class="gap-6 md:grid-cols-2 xl:grid-cols-4 grid p-6">
@foreach($this->blocks as $block)
<x-ui::box title="{{$block->title()}}" :second="true">

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,10 @@
<template>
<div class="h-24 p-6 md:px-10 bg-primary-800 flex justify-between items-center w-full">
<span class="text-primary-500 text-xl"><slot></slot></span>
<img src="../../../img/dpsg.gif" class="w-24" />
</div>
</template>
<script>
export default {};
</script>

View File

@ -0,0 +1,36 @@
<template>
<page-full-layout banner>
<template #heading>
<page-full-heading-banner>Login</page-full-heading-banner>
</template>
<form @submit.prevent="submit">
<div class="grid gap-5">
<f-text id="email" v-model="values.email" label="E-Mail-Adresse"></f-text>
<f-text id="password" v-model="values.password" type="password" label="Passwort"></f-text>
<button type="submit" class="btn btn-primary">Login</button>
</div>
</form>
</page-full-layout>
</template>
<script>
import FullLayout from '../layouts/FullLayout.vue';
export default {
layout: FullLayout,
data: function () {
return {
values: {
email: '',
password: '',
},
};
},
methods: {
submit() {
this.$inertia.post('/login', this.values);
},
},
};
</script>

View File

@ -0,0 +1,39 @@
<template>
<page-full-layout banner>
<template #heading>
<page-full-heading-banner>Login</page-full-heading-banner>
</template>
<form @submit.prevent="submit">
<div class="grid gap-5">
<f-text id="email" v-model="values.email" label="E-Mail-Adresse"></f-text>
<f-text id="password" v-model="values.password" type="password" label="Passwort"></f-text>
<button type="submit" class="btn btn-primary">Login</button>
<div class="flex justify-center">
<button type="button" class="text-gray-500 text-sm hover:text-gray-300" @click.prevent="$inertia.visit('/password/reset')">Passwort vergessen?</button>
</div>
</div>
</form>
</page-full-layout>
</template>
<script>
import FullLayout from '../../layouts/FullLayout.vue';
export default {
layout: FullLayout,
data: function () {
return {
values: {
email: '',
password: '',
},
};
},
methods: {
submit() {
this.$inertia.post('/login', this.values);
},
},
};
</script>

View File

@ -12,6 +12,6 @@ return [
|
*/
'failed' => 'Login fehlgeschlagen.',
'failed' => 'Diese Kombination aus Zugangsdaten wurde nicht in unserer Datenbank gefunden.',
'throttle' => 'Zu viele Loginversuche. Versuchen Sie es bitte in :seconds Sekunden nochmal.',
];

View File

@ -1,12 +0,0 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>{{ session()->get('title') }} | {{ config('app.name') }}</title>
<meta name="socketport" content="{{env('SOCKET_PORT')}}" />
<meta name="adrema_base_url" content="/">
@if(auth()->id())
<meta name="meilisearch_key" content="{{config('scout.meilisearch.key')}}" />
@endif
@vite('resources/livewire-js/app.js')
</head>

View File

@ -1,6 +1,17 @@
<!DOCTYPE html>
<html class="h-full" lang="de">
<x-head></x-head>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>{{ session()->get('title') }} | {{ config('app.name') }}</title>
<meta name="socketport" content="{{env('SOCKET_PORT')}}" />
<meta name="adrema_base_url" content="/">
@if(auth()->id())
<meta name="meilisearch_key" content="{{config('scout.meilisearch.key')}}" />
@endif
@vite('resources/livewire-js/app.js')
</head>
<body class="min-h-full flex flex-col">
<livewire:page.sidebar />
{{ $slot }}

View File

@ -1,8 +0,0 @@
<!DOCTYPE html>
<html class="h-full" lang="de">
<x-head></x-head>
<body class="min-h-full flex justify-center items-center bg-gray-900">
{{ $slot }}
@livewireScriptConfig
</body>
</html>

View File

@ -76,7 +76,9 @@ use App\Membership\Actions\MembershipStoreAction;
use App\Membership\Actions\MembershipUpdateAction;
use App\Payment\SubscriptionController;
Route::group(['namespace' => 'App\\Http\\Controllers'], function (): void {
Auth::routes(['register' => false]);
});
Route::group(['middleware' => 'auth:web'], function (): void {
Route::post('/nami/login-check', NamiLoginCheckAction::class)->name('nami.login-check');

View File

@ -0,0 +1,44 @@
<?php
namespace Tests\Feature\Authentication;
use App\Auth\ResetPassword;
use App\User;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Notification;
use Tests\TestCase;
class ForgotPasswordTest extends TestCase
{
use DatabaseTransactions;
public function testItShowsResetForm(): void
{
$this->withoutExceptionHandling();
$this->get('/password/reset')->assertComponent('authentication/PasswordReset');
}
public function testItRequiresAnEmailAddress(): void
{
$this->postJson('/password/email')->assertJsonValidationErrors(['email' => 'E-Mail Adresse ist erforderlich.']);
}
public function testItNeedsAnActiveUser(): void
{
$this->postJson('/password/email', [
'email' => 'test@aa.de',
])->assertJsonValidationErrors(['email' => 'Es konnte leider kein Nutzer mit dieser E-Mail-Adresse gefunden werden.']);
}
public function testItSendsPasswordResetLink(): void
{
Notification::fake();
$user = User::factory()->create(['email' => 'test@aa.de']);
$this->postJson('/password/email', [
'email' => 'test@aa.de',
])->assertOk();
Notification::assertSentTo($user, ResetPassword::class);
}
}

View File

@ -39,18 +39,6 @@ class PreventionTest extends TestCase
$this->assertEquals(now()->format('Y-m-d'), $participant->fresh()->last_remembered_at->format('Y-m-d'));
}
public function testItDoesntRememberPastEvents(): void
{
Mail::fake();
$form = $this->createForm();
$participant = $this->createParticipant($form);
$form->update(['from' => now()->subDay()]);
PreventionRememberAction::run();
$this->assertNull($participant->fresh()->last_remembered_at);
}
public function testItDoesntRememberWhenConditionDoesntMatch(): void
{
Mail::fake();