Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2b12c36af | ||
|
|
04ffe155bd |
@@ -2,16 +2,24 @@
|
|||||||
|
|
||||||
namespace App\Actions\Fortify;
|
namespace App\Actions\Fortify;
|
||||||
|
|
||||||
|
use App\Actions\Teams\AcceptTeamInvite;
|
||||||
use App\Concerns\PasswordValidationRules;
|
use App\Concerns\PasswordValidationRules;
|
||||||
use App\Concerns\ProfileValidationRules;
|
use App\Concerns\ProfileValidationRules;
|
||||||
|
use App\Models\TeamInvite;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use Illuminate\Validation\ValidationException;
|
||||||
use Laravel\Fortify\Contracts\CreatesNewUsers;
|
use Laravel\Fortify\Contracts\CreatesNewUsers;
|
||||||
|
|
||||||
class CreateNewUser implements CreatesNewUsers
|
class CreateNewUser implements CreatesNewUsers
|
||||||
{
|
{
|
||||||
use PasswordValidationRules, ProfileValidationRules;
|
use PasswordValidationRules, ProfileValidationRules;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
private AcceptTeamInvite $acceptTeamInvite,
|
||||||
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate and create a newly registered user.
|
* Validate and create a newly registered user.
|
||||||
*
|
*
|
||||||
@@ -19,15 +27,43 @@ class CreateNewUser implements CreatesNewUsers
|
|||||||
*/
|
*/
|
||||||
public function create(array $input): User
|
public function create(array $input): User
|
||||||
{
|
{
|
||||||
Validator::make($input, [
|
$validated = Validator::make($input, [
|
||||||
...$this->profileRules(),
|
...$this->profileRules(),
|
||||||
'password' => $this->passwordRules(),
|
'password' => $this->passwordRules(),
|
||||||
|
'invite_token' => ['nullable', 'string', 'size:128'],
|
||||||
])->validate();
|
])->validate();
|
||||||
|
|
||||||
return User::create([
|
return DB::transaction(function () use ($validated): User {
|
||||||
'name' => $input['name'],
|
$invite = null;
|
||||||
'email' => $input['email'],
|
|
||||||
'password' => $input['password'],
|
if (! empty($validated['invite_token'])) {
|
||||||
|
$invite = TeamInvite::findByPlainToken($validated['invite_token'])
|
||||||
|
->lockForUpdate()
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (
|
||||||
|
$invite === null
|
||||||
|
|| mb_strtolower($invite->invited_email)
|
||||||
|
!== mb_strtolower($validated['email'])
|
||||||
|
) {
|
||||||
|
throw ValidationException::withMessages([
|
||||||
|
'invite_token' => 'Die Einladung ist ungültig oder gehört zu einer anderen E-Mail-Adresse.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$user = User::create([
|
||||||
|
'name' => $validated['name'],
|
||||||
|
'email' => $validated['email'],
|
||||||
|
'password' => $validated['password'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($invite !== null) {
|
||||||
|
$invite->team->members()->attach($user);
|
||||||
|
$invite->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $user;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,42 +130,4 @@ class TeamController extends Controller
|
|||||||
'taken' => $this->isReserved($slug) || ($slug !== $ignoredSlug && Team::whereSlug($slug)->exists()),
|
'taken' => $this->isReserved($slug) || ($slug !== $ignoredSlug && Team::whereSlug($slug)->exists()),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invite(Request $request, Team $team)
|
|
||||||
{
|
|
||||||
$validated = $request->validate([
|
|
||||||
'email' => 'required|email|max:255',
|
|
||||||
]);
|
|
||||||
|
|
||||||
abort_unless(auth()->user()->can('manage', $team), 403);
|
|
||||||
|
|
||||||
$team->invites()->create([
|
|
||||||
'invited_email' => Arr::get($validated, 'email'),
|
|
||||||
'invited_by_user_id' => auth()->user()->id,
|
|
||||||
]);
|
|
||||||
|
|
||||||
Inertia::flash('success', 'User invited to your team.');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function revokeInvite(Request $request, Team $team): RedirectResponse
|
|
||||||
{
|
|
||||||
$validated = $request->validate([
|
|
||||||
'email' => 'required|email|max:255',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$teamInvite = $team->invites()->whereInvitedEmail(Arr::get($validated, 'email'))->firstOrFail();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$teamInvite->delete();
|
|
||||||
} catch (\Exception $exception) {
|
|
||||||
report($exception);
|
|
||||||
Inertia::flash('error', 'could not delete user invite.');
|
|
||||||
|
|
||||||
return to_route('teams.show', $team);
|
|
||||||
}
|
|
||||||
|
|
||||||
Inertia::flash('success', 'successfully deleted user invite.');
|
|
||||||
|
|
||||||
return to_route('teams.show', $team);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\Team;
|
||||||
|
use App\Models\TeamInvite;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use Inertia\Inertia;
|
||||||
|
|
||||||
|
class TeamInviteController extends Controller
|
||||||
|
{
|
||||||
|
public function store(Request $request, Team $team)
|
||||||
|
{
|
||||||
|
$validated = $request->validate([
|
||||||
|
'email' => 'required|email|max:255',
|
||||||
|
]);
|
||||||
|
|
||||||
|
abort_unless(auth()->user()->can('manage', $team), 403);
|
||||||
|
|
||||||
|
$invited = Arr::get($validated, 'email');
|
||||||
|
$inviter = auth()->user()->id;
|
||||||
|
|
||||||
|
$exists = TeamInvite::whereInvitedEmail($invited)
|
||||||
|
->whereTeamId($team->id)
|
||||||
|
->exists();
|
||||||
|
|
||||||
|
if ($exists) {
|
||||||
|
Inertia::flash('warning', 'This Person is already invited to this team.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$team->invites()->create([
|
||||||
|
'invited_email' => $invited,
|
||||||
|
'invited_by_user_id' => $inviter,
|
||||||
|
]);
|
||||||
|
|
||||||
|
Inertia::flash('success', 'User invited to your team.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, Team $team): RedirectResponse
|
||||||
|
{
|
||||||
|
$validated = $request->validate([
|
||||||
|
'email' => 'required|email|max:255',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$teamInvite = $team->invites()->whereInvitedEmail(Arr::get($validated, 'email'))->firstOrFail();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$teamInvite->delete();
|
||||||
|
} catch (\Exception $exception) {
|
||||||
|
report($exception);
|
||||||
|
Inertia::flash('error', 'could not delete user invite.');
|
||||||
|
|
||||||
|
return to_route('teams.show', $team);
|
||||||
|
}
|
||||||
|
|
||||||
|
Inertia::flash('success', 'successfully deleted user invite.');
|
||||||
|
|
||||||
|
return to_route('teams.show', $team);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,6 +60,11 @@ class InviteToTeam extends Notification
|
|||||||
? 'register'
|
? 'register'
|
||||||
: 'teams.invite.create',
|
: 'teams.invite.create',
|
||||||
['inviteToken' => $invite->plainInviteToken()]
|
['inviteToken' => $invite->plainInviteToken()]
|
||||||
|
+ (
|
||||||
|
$user === null
|
||||||
|
? ['email' => $invite->invited_email]
|
||||||
|
: []
|
||||||
|
)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,8 +67,10 @@ class FortifyServiceProvider extends ServiceProvider
|
|||||||
'status' => $request->session()->get('status'),
|
'status' => $request->session()->get('status'),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
Fortify::registerView(fn () => Inertia::render('auth/Register', [
|
Fortify::registerView(fn (Request $request) => Inertia::render('auth/Register', [
|
||||||
'passwordRules' => Password::defaults()->toPasswordRulesString(),
|
'passwordRules' => Password::defaults()->toPasswordRulesString(),
|
||||||
|
'inviteToken' => $request->query('inviteToken'),
|
||||||
|
'email' => $request->query('email'),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
Fortify::twoFactorChallengeView(fn () => Inertia::render('auth/TwoFactorChallenge'));
|
Fortify::twoFactorChallengeView(fn () => Inertia::render('auth/TwoFactorChallenge'));
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script lang="ts" setup>
|
||||||
import { Form, Head } from '@inertiajs/vue3';
|
import {Form, Head} from '@inertiajs/vue3';
|
||||||
import InputError from '@/components/InputError.vue';
|
import InputError from '@/components/InputError.vue';
|
||||||
import PasswordInput from '@/components/PasswordInput.vue';
|
import PasswordInput from '@/components/PasswordInput.vue';
|
||||||
import TextLink from '@/components/TextLink.vue';
|
import TextLink from '@/components/TextLink.vue';
|
||||||
import { Button } from '@/components/ui/button';
|
import {Button} from '@/components/ui/button';
|
||||||
import { Input } from '@/components/ui/input';
|
import {Input} from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import {Label} from '@/components/ui/label';
|
||||||
import { Spinner } from '@/components/ui/spinner';
|
import {Spinner} from '@/components/ui/spinner';
|
||||||
import { login } from '@/routes';
|
import {login} from '@/routes';
|
||||||
import { store } from '@/routes/register';
|
import {store} from '@/routes/register';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
passwordRules: string;
|
passwordRules: string;
|
||||||
|
inviteToken?: string;
|
||||||
|
email?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -26,23 +28,23 @@ defineOptions({
|
|||||||
<Head title="Register" />
|
<Head title="Register" />
|
||||||
|
|
||||||
<Form
|
<Form
|
||||||
v-bind="store.form()"
|
|
||||||
:reset-on-success="['password', 'password_confirmation']"
|
|
||||||
v-slot="{ errors, processing }"
|
v-slot="{ errors, processing }"
|
||||||
|
:reset-on-success="['password', 'password_confirmation']"
|
||||||
class="flex flex-col gap-6"
|
class="flex flex-col gap-6"
|
||||||
|
v-bind="store.form()"
|
||||||
>
|
>
|
||||||
<div class="grid gap-6">
|
<div class="grid gap-6">
|
||||||
<div class="grid gap-2">
|
<div class="grid gap-2">
|
||||||
<Label for="name">Name</Label>
|
<Label for="name">Name</Label>
|
||||||
<Input
|
<Input
|
||||||
id="name"
|
id="name"
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
autofocus
|
|
||||||
:tabindex="1"
|
:tabindex="1"
|
||||||
autocomplete="name"
|
autocomplete="name"
|
||||||
|
autofocus
|
||||||
name="name"
|
name="name"
|
||||||
placeholder="Full name"
|
placeholder="Full name"
|
||||||
|
required
|
||||||
|
type="text"
|
||||||
/>
|
/>
|
||||||
<InputError :message="errors.name" />
|
<InputError :message="errors.name" />
|
||||||
</div>
|
</div>
|
||||||
@@ -51,12 +53,14 @@ defineOptions({
|
|||||||
<Label for="email">Email address</Label>
|
<Label for="email">Email address</Label>
|
||||||
<Input
|
<Input
|
||||||
id="email"
|
id="email"
|
||||||
type="email"
|
:model-value="email"
|
||||||
required
|
:readonly="email !== null"
|
||||||
:tabindex="2"
|
:tabindex="2"
|
||||||
autocomplete="email"
|
autocomplete="email"
|
||||||
name="email"
|
name="email"
|
||||||
placeholder="email@example.com"
|
placeholder="email@example.com"
|
||||||
|
required
|
||||||
|
type="email"
|
||||||
/>
|
/>
|
||||||
<InputError :message="errors.email" />
|
<InputError :message="errors.email" />
|
||||||
</div>
|
</div>
|
||||||
@@ -65,12 +69,12 @@ defineOptions({
|
|||||||
<Label for="password">Password</Label>
|
<Label for="password">Password</Label>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
id="password"
|
id="password"
|
||||||
required
|
:passwordrules="passwordRules"
|
||||||
:tabindex="3"
|
:tabindex="3"
|
||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
name="password"
|
name="password"
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
:passwordrules="passwordRules"
|
required
|
||||||
/>
|
/>
|
||||||
<InputError :message="errors.password" />
|
<InputError :message="errors.password" />
|
||||||
</div>
|
</div>
|
||||||
@@ -79,22 +83,32 @@ defineOptions({
|
|||||||
<Label for="password_confirmation">Confirm password</Label>
|
<Label for="password_confirmation">Confirm password</Label>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
id="password_confirmation"
|
id="password_confirmation"
|
||||||
required
|
:passwordrules="passwordRules"
|
||||||
:tabindex="4"
|
:tabindex="4"
|
||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
name="password_confirmation"
|
name="password_confirmation"
|
||||||
placeholder="Confirm password"
|
placeholder="Confirm password"
|
||||||
:passwordrules="passwordRules"
|
required
|
||||||
/>
|
/>
|
||||||
<InputError :message="errors.password_confirmation" />
|
<InputError :message="errors.password_confirmation" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="grid gap-2">
|
||||||
|
<PasswordInput
|
||||||
|
id="invite_token"
|
||||||
|
:model-value="inviteToken"
|
||||||
|
name="invite_token"
|
||||||
|
type="hidden"
|
||||||
|
/>
|
||||||
|
<InputError :message="errors.invite_token" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
|
||||||
class="mt-2 w-full"
|
|
||||||
tabindex="5"
|
|
||||||
:disabled="processing"
|
:disabled="processing"
|
||||||
|
class="mt-2 w-full"
|
||||||
data-test="register-user-button"
|
data-test="register-user-button"
|
||||||
|
tabindex="5"
|
||||||
|
type="submit"
|
||||||
>
|
>
|
||||||
<Spinner v-if="processing" />
|
<Spinner v-if="processing" />
|
||||||
Create account
|
Create account
|
||||||
@@ -105,8 +119,8 @@ defineOptions({
|
|||||||
Already have an account?
|
Already have an account?
|
||||||
<TextLink
|
<TextLink
|
||||||
:href="login()"
|
:href="login()"
|
||||||
class="underline underline-offset-4"
|
|
||||||
:tabindex="6"
|
:tabindex="6"
|
||||||
|
class="underline underline-offset-4"
|
||||||
>Log in</TextLink
|
>Log in</TextLink
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import teamRoutes from '@/routes/teams';
|
import teamRoutes from '@/routes/teams';
|
||||||
import { Head, Link, setLayoutProps, useForm } from '@inertiajs/vue3';
|
import {Form, Head, Link, setLayoutProps, useForm} from '@inertiajs/vue3';
|
||||||
import type { Team, TeamInvite } from '@/types/models';
|
import type {Team, TeamInvite} from '@/types/models';
|
||||||
import InputError from '@/components/InputError.vue';
|
import InputError from '@/components/InputError.vue';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import {Card, CardContent} from '@/components/ui/card';
|
||||||
import {
|
import {Table, TableBody, TableCell, TableHead, TableHeader, TableRow,} from '@/components/ui/table';
|
||||||
Table,
|
import {Button} from '@/components/ui/button';
|
||||||
TableBody,
|
import {Pencil, Plus, Trash} from '@lucide/vue';
|
||||||
TableCell,
|
import {Input} from "@/components/ui/input";
|
||||||
TableHead,
|
import {Label} from "@/components/ui/label";
|
||||||
TableHeader,
|
|
||||||
TableRow,
|
|
||||||
} from '@/components/ui/table';
|
|
||||||
import { Button } from '@/components/ui/button';
|
|
||||||
import { Pencil, Trash } from '@lucide/vue';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
team: Team;
|
team: Team;
|
||||||
@@ -34,7 +29,7 @@ setLayoutProps({
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const revokeForm = useForm({ email: '' });
|
const revokeForm = useForm({email: ''});
|
||||||
|
|
||||||
function revokeInvite(invite: TeamInvite): void {
|
function revokeInvite(invite: TeamInvite): void {
|
||||||
if (revokeForm.processing) {
|
if (revokeForm.processing) {
|
||||||
@@ -42,7 +37,7 @@ function revokeInvite(invite: TeamInvite): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
revokeForm.email = invite.invitedEmail;
|
revokeForm.email = invite.invitedEmail;
|
||||||
revokeForm.submit(teamRoutes.invite.revoke({ team: props.team.slug }), {
|
revokeForm.submit(teamRoutes.invite.revoke({team: props.team.slug}), {
|
||||||
preserveScroll: true,
|
preserveScroll: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -50,11 +45,11 @@ function revokeInvite(invite: TeamInvite): void {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col justify-center p-16">
|
<div class="flex flex-col justify-center p-16">
|
||||||
<Head title="Teams" />
|
<Head title="Teams"/>
|
||||||
<div v-if="canManageTeam" class="flex w-full justify-end py-4">
|
<div v-if="canManageTeam" class="flex w-full justify-end py-4">
|
||||||
<Link :href="teamRoutes.edit({ team: team.slug })">
|
<Link :href="teamRoutes.edit({ team: team.slug })">
|
||||||
<Button>
|
<Button>
|
||||||
<component :is="Pencil" />
|
<component :is="Pencil"/>
|
||||||
Bearbeiten
|
Bearbeiten
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -73,7 +68,8 @@ function revokeInvite(invite: TeamInvite): void {
|
|||||||
<TableCell class="font-bold">Erfordert 2FA:</TableCell>
|
<TableCell class="font-bold">Erfordert 2FA:</TableCell>
|
||||||
<TableCell>{{
|
<TableCell>{{
|
||||||
team.multi_factor_required ? 'Ja' : 'Nein'
|
team.multi_factor_required ? 'Ja' : 'Nein'
|
||||||
}}</TableCell>
|
}}
|
||||||
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell class="font-bold">Erstellt am:</TableCell>
|
<TableCell class="font-bold">Erstellt am:</TableCell>
|
||||||
@@ -102,7 +98,8 @@ function revokeInvite(invite: TeamInvite): void {
|
|||||||
<TableCell>{{ member.email }}</TableCell>
|
<TableCell>{{ member.email }}</TableCell>
|
||||||
<TableCell>{{
|
<TableCell>{{
|
||||||
member.has_multi_factor ? 'Ja' : 'Nein'
|
member.has_multi_factor ? 'Ja' : 'Nein'
|
||||||
}}</TableCell>
|
}}
|
||||||
|
</TableCell>
|
||||||
<TableCell>{{ member.role }}</TableCell>
|
<TableCell>{{ member.role }}</TableCell>
|
||||||
<TableCell>{{ member.joined_at }}</TableCell>
|
<TableCell>{{ member.joined_at }}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
@@ -112,8 +109,28 @@ function revokeInvite(invite: TeamInvite): void {
|
|||||||
</Card>
|
</Card>
|
||||||
<Card v-if="teamInvites" class="mb-8 w-full">
|
<Card v-if="teamInvites" class="mb-8 w-full">
|
||||||
<CardContent>
|
<CardContent>
|
||||||
|
<div class="flex justify-between">
|
||||||
<h2 class="text-lg font-semibold">Ausstehende Invites</h2>
|
<h2 class="text-lg font-semibold">Ausstehende Invites</h2>
|
||||||
<InputError :message="revokeForm.errors.email" />
|
<Card class="border-neutral-500 b-2">
|
||||||
|
<CardContent>
|
||||||
|
<Form v-slot="{ errors, processing }" :action="teamRoutes.invite.invite({team: team.slug})"
|
||||||
|
class="flex gap-2 justify-end items-end"
|
||||||
|
method="POST"
|
||||||
|
>
|
||||||
|
<div class="grid gap-y-2">
|
||||||
|
<Label for="email">Email:</Label>
|
||||||
|
<Input id="email" name="email" placeholder="user@example.com" type="email"/>
|
||||||
|
<InputError :message="errors.email"/>
|
||||||
|
</div>
|
||||||
|
<Button :disabled="processing" type="submit" variant="secondary">
|
||||||
|
<component :is="Plus"/>
|
||||||
|
Einladen
|
||||||
|
</Button>
|
||||||
|
</Form>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<InputError :message="revokeForm.errors.email"/>
|
||||||
<Table>
|
<Table>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@@ -129,14 +146,14 @@ function revokeInvite(invite: TeamInvite): void {
|
|||||||
<TableCell>{{ invite.invitedAt }}</TableCell>
|
<TableCell>{{ invite.invitedAt }}</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Button
|
<Button
|
||||||
|
:aria-label="`Einladung für ${invite.invitedEmail} widerrufen`"
|
||||||
|
:disabled="revokeForm.processing"
|
||||||
|
size="icon"
|
||||||
type="button"
|
type="button"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
|
||||||
:disabled="revokeForm.processing"
|
|
||||||
:aria-label="`Einladung für ${invite.invitedEmail} widerrufen`"
|
|
||||||
@click="revokeInvite(invite)"
|
@click="revokeInvite(invite)"
|
||||||
>
|
>
|
||||||
<Trash :size="18" />
|
<Trash :size="18"/>
|
||||||
</Button>
|
</Button>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|||||||
+3
-2
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use App\Http\Controllers\TeamController;
|
use App\Http\Controllers\TeamController;
|
||||||
use App\Http\Controllers\TeamInviteAcceptController;
|
use App\Http\Controllers\TeamInviteAcceptController;
|
||||||
|
use App\Http\Controllers\TeamInviteController;
|
||||||
use App\Models\Team;
|
use App\Models\Team;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
@@ -14,8 +15,8 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::name('invite.')->group(function () {
|
Route::name('invite.')->group(function () {
|
||||||
Route::get('invite/accept', [TeamInviteAcceptController::class, 'create'])->name('create');
|
Route::get('invite/accept', [TeamInviteAcceptController::class, 'create'])->name('create');
|
||||||
Route::post('invite/accept', [TeamInviteAcceptController::class, 'store'])->name('store');
|
Route::post('invite/accept', [TeamInviteAcceptController::class, 'store'])->name('store');
|
||||||
Route::post('{team:slug}/invite', [TeamController::class, 'invite'])->name('invite');
|
Route::post('{team:slug}/invite', [TeamInviteController::class, 'store'])->name('invite');
|
||||||
Route::post('{team:slug}/invite/revoke', [TeamController::class, 'revokeInvite'])->name('revoke')->can('manage', 'team');
|
Route::post('{team:slug}/invite/revoke', [TeamInviteController::class, 'destroy'])->name('revoke')->can('manage', 'team');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
|
|||||||
Reference in New Issue
Block a user