Compare commits

..
8 Commits
Author SHA1 Message Date
Twyco ec93510f4b Delete expires ots & add duration to create
CI/CD / test_and_check_app (push) Failing after 53s
CI/CD / Publish immutable image (push) Skipped
2026-10-13 09:56:53 +02:00
Twyco 8fadceabed added created view and confirm show
CI/CD / test_and_check_app (push) Failing after 48s
CI/CD / Publish immutable image (push) Skipped
2026-10-10 23:29:45 +02:00
Twyco 095ce60d8f formatting
CI/CD / Publish immutable image (push) Skipped
CI/CD / test_and_check_app (push) Failing after 48s
2026-10-08 13:52:19 +02:00
Twyco d0c606494e Added OTS create,store,show
CI/CD / test_and_check_app (push) Failing after 45s
CI/CD / Publish immutable image (push) Skipped
2026-10-08 13:51:40 +02:00
Twyco 494d1a49e5 require 2fa if enabled
CI/CD / test_and_check_app (push) Failing after 46s
CI/CD / Publish immutable image (push) Skipped
2026-10-08 11:36:41 +02:00
Twyco b6e0ec539c require 2fa if enabled
CI/CD / test_and_check_app (push) Failing after 47s
CI/CD / Publish immutable image (push) Skipped
2026-10-08 11:29:28 +02:00
Twyco f2b12c36af Add New registered user
CI/CD / test_and_check_app (push) Failing after 55s
CI/CD / Publish immutable image (push) Skipped
2026-10-04 15:08:00 +02:00
Twyco 04ffe155bd Team Invite 2026-10-03 09:05:30 +02:00
30 changed files with 742 additions and 548 deletions
+41 -6
View File
@@ -2,16 +2,24 @@
namespace App\Actions\Fortify;
use App\Actions\Teams\AcceptTeamInvite;
use App\Concerns\PasswordValidationRules;
use App\Concerns\ProfileValidationRules;
use App\Models\TeamInvite;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\ValidationException;
use Laravel\Fortify\Contracts\CreatesNewUsers;
class CreateNewUser implements CreatesNewUsers
{
use PasswordValidationRules, ProfileValidationRules;
public function __construct(
private readonly AcceptTeamInvite $acceptTeamInvite,
) {}
/**
* Validate and create a newly registered user.
*
@@ -19,15 +27,42 @@ class CreateNewUser implements CreatesNewUsers
*/
public function create(array $input): User
{
Validator::make($input, [
$validated = Validator::make($input, [
...$this->profileRules(),
'password' => $this->passwordRules(),
'invite_token' => ['nullable', 'string', 'size:128'],
])->validate();
return User::create([
'name' => $input['name'],
'email' => $input['email'],
'password' => $input['password'],
]);
return DB::transaction(function () use ($validated): User {
$invite = null;
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) {
($this->acceptTeamInvite)($invite, $user);
}
return $user;
});
}
}
+9 -3
View File
@@ -5,15 +5,21 @@ namespace App\Actions\Teams;
use App\Models\TeamInvite;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException;
readonly class AcceptTeamInvite
{
public function __invoke(TeamInvite $invite): void
public function __invoke(TeamInvite $invite, User $newUser): void
{
abort_unless(auth()->user()->email === $invite->invited_email, 403);
abort_unless($newUser->email === $invite->invited_email, 403);
$team = $invite->team;
$newUser = User::whereEmail($invite->invited_email)->firstOrFail();
if ($invite->team->require_2fa && ! $newUser->hasEnabledTwoFactorAuthentication()) {
throw ValidationException::withMessages([
'require_2fa' => 'Du musst 2FA einrichten, damit du dem Team beitreten kannst',
]);
}
try {
DB::transaction(function () use ($team, $newUser, $invite) {
@@ -0,0 +1,19 @@
<?php
namespace App\Console\Commands;
use App\Models\OneTimeSecret;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
#[Signature('app:delete-expired-one-time-secrets')]
class DeleteExpiredOneTimeSecrets extends Command
{
/**
* Execute the console command.
*/
public function handle(): void
{
OneTimeSecret::whereDate('expires_at', '<', now())->delete();
}
}
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Enums;
enum OneTimeSecretDuration: int
{
case ThirtyMinutes = 1800;
case OneHour = 3600;
case SixHours = 21_600;
case OneDay = 86_400;
case ThreeDays = 259_200;
case OneWeek = 604_800;
public function label(): string
{
return match ($this) {
self::ThirtyMinutes => '30 Minutes',
self::OneHour => '1 Hour',
self::SixHours => '6 Hours',
self::OneDay => '1 Day',
self::ThreeDays => '3 Days',
self::OneWeek => '1 Week',
};
}
}
+73
View File
@@ -0,0 +1,73 @@
<?php
namespace App\Http\Controllers;
use App\Enums\OneTimeSecretDuration;
use App\Http\Requests\StoreOTSRequest;
use App\Models\OneTimeSecret;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
class OTSController extends Controller
{
public function created(Request $request)
{
$link = $request->session()->get('otsLink');
$request->session()->remove('otsLink');
if (! $link) {
return redirect()->route('ots.create');
}
return Inertia::render('ots/Created', [
'otsLink' => $link,
]);
}
public function store(StoreOTSRequest $request): RedirectResponse
{
$validated = $request->validated();
$ots = OneTimeSecret::create([
'secret' => $validated['secret'],
'expires_at' => now()->addSeconds($validated['duration']),
]);
$otsLink = route('ots.show', ['oneTimeSecret' => $ots->id]);
return redirect()->route('ots.created')->with(['otsLink' => $otsLink]);
}
public function create(): Response
{
return Inertia::render('ots/Create', [
'durations' => array_map(
fn (OneTimeSecretDuration $duration): array => [
'value' => $duration->value,
'label' => $duration->label(),
],
OneTimeSecretDuration::cases(),
),
]);
}
public function show(OneTimeSecret $oneTimeSecret): Response|RedirectResponse
{
if ($oneTimeSecret->expires_at->isPast()) {
$oneTimeSecret->delete();
return redirect()->route('ots.create');
}
return Inertia::render('ots/Show', ['oneTimeSecretId' => $oneTimeSecret->id]);
}
public function reveal(OneTimeSecret $oneTimeSecret): JsonResponse|RedirectResponse
{
$oneTimeSecret->delete();
if ($oneTimeSecret->expires_at->isPast()) {
return redirect()->route('ots.create');
}
return response()->json(['secret' => $oneTimeSecret->secret]);
}
}
+24 -42
View File
@@ -15,9 +15,12 @@ use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
use Inertia\Response;
// TODO if a team requires 2fa after non 2fa users joins
class TeamController extends Controller
{
use ReservedSlugs;
@@ -50,10 +53,18 @@ class TeamController extends Controller
*/
public function store(StoreTeamRequest $request): RedirectResponse
{
$validated = $request->validated();
$user = $request->user();
if (Arr::get($validated, 'require_2fa', false) && ! $user->hasEnabledTwoFactorAuthentication()) {
throw ValidationException::withMessages([
'require_2fa' => 'Du musst 2FA einrichten, damit du 2FA aktivieren kannst!',
]);
}
try {
DB::transaction(function () use ($request): void {
$team = Team::create($request->validated());
$team->members()->attach($request->user(), ['role' => TeamMemberRole::Owner]);
DB::transaction(function () use ($validated, $user): void {
$team = Team::create($validated);
$team->members()->attach($user, ['role' => TeamMemberRole::Owner]);
});
} catch (\Exception $exception) {
report($exception);
@@ -69,7 +80,7 @@ class TeamController extends Controller
public function create(): Response
{
return Inertia::render('team/Create');
return Inertia::render('team/Create', []);
}
/**
@@ -87,6 +98,15 @@ class TeamController extends Controller
*/
public function update(UpdateTeamRequest $request, Team $team): RedirectResponse
{
$validated = $request->validated();
$user = $request->user();
if (Arr::get($validated, 'require_2fa', false) && ! $user->hasEnabledTwoFactorAuthentication()) {
throw ValidationException::withMessages([
'require_2fa' => 'Du musst 2FA einrichten, damit du 2FA aktivieren kannst!',
]);
}
try {
$team->update($request->validated());
} catch (\Exception $exception) {
@@ -130,42 +150,4 @@ class TeamController extends Controller
'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);
}
}
@@ -17,7 +17,7 @@ class TeamInviteAcceptController extends Controller
$invite = TeamInvite::findByPlainToken($inviteToken)->first();
if ($invite) {
$accept($invite);
$accept($invite, $request->user());
return to_route('teams.index');
}
@@ -32,7 +32,7 @@ class TeamInviteAcceptController extends Controller
{
$request->validated();
$accept($request->teamInvite());
$accept($request->teamInvite(), $request->user());
return to_route('teams.index');
}
@@ -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);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Requests;
use App\Enums\OneTimeSecretDuration;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreOTSRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'secret' => 'required|string',
'duration' => ['required', 'integer', Rule::enum(OneTimeSecretDuration::class)],
];
}
}
+61
View File
@@ -0,0 +1,61 @@
<?php
namespace App\Models;
use Carbon\CarbonImmutable;
use Database\Factories\OneTimeSecretFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
/**
* @property int $id
* @property string|null $recipient_type
* @property int|null $recipient_id
* @property int|null $team_id
* @property string $secret
* @property string $expires_at
* @property CarbonImmutable|null $created_at
* @property CarbonImmutable|null $updated_at
* @property-read User|Team|null $recipient
* @property-read Team|null $team
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereExpiresAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereRecipientId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereRecipientType($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereSecret($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereTeamId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|OneTimeSecret whereUpdatedAt($value)
*
* @mixin \Eloquent
*/
#[Fillable(['secret', 'expires_at'])]
class OneTimeSecret extends Model
{
use HasUuids;
public function team(): BelongsTo
{
return $this->belongsTo(Team::class);
}
public function recipient(): MorphTo
{
return $this->morphTo();
}
protected function casts(): array
{
return [
'secret' => 'encrypted',
'expires_at' => 'datetime',
];
}
}
+8
View File
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
/**
* @property int $id
@@ -23,6 +24,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
* @property-read TeamMember|null $pivot
* @property-read Collection<int, User> $members
* @property-read int|null $members_count
* @property-read Collection<int, OneTimeSecret> $receivedOneTimeSecrets
* @property-read int|null $received_one_time_secrets_count
*
* @method static Builder<static>|Team newModelQuery()
* @method static Builder<static>|Team newQuery()
@@ -53,6 +56,11 @@ class Team extends Model
return $this->hasMany(TeamInvite::class);
}
public function receivedOneTimeSecrets(): MorphMany
{
return $this->morphMany(OneTimeSecret::class, 'recipient');
}
#[Scope]
public function scopeVisibleTo(Builder $query, User $user): Builder
{
+16 -8
View File
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Attributes\Hidden;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\DatabaseNotification;
use Illuminate\Notifications\DatabaseNotificationCollection;
@@ -35,6 +36,8 @@ use Laravel\Passkeys\Passkey;
* @property-read int|null $notifications_count
* @property-read Collection<int, Passkey> $passkeys
* @property-read int|null $passkeys_count
* @property-read Collection<int, OneTimeSecret> $receivedOneTimeSecrets
* @property-read int|null $received_one_time_secrets_count
* @property-read TeamMember|null $pivot
* @property-read Collection<int, Team> $teams
* @property-read int|null $teams_count
@@ -64,6 +67,19 @@ class User extends Authenticatable implements MustVerifyEmail, PasskeyUser
/** @use HasFactory<UserFactory> */
use HasFactory, Notifiable, PasskeyAuthenticatable, TwoFactorAuthenticatable;
public function teams(): BelongsToMany
{
return $this->belongsToMany(Team::class, 'team_members')
->using(TeamMember::class)
->withPivot(['role'])
->withTimestamps();
}
public function receivedOneTimeSecrets(): MorphMany
{
return $this->morphMany(OneTimeSecret::class, 'recipient');
}
/**
* Get the attributes that should be cast.
*
@@ -77,12 +93,4 @@ class User extends Authenticatable implements MustVerifyEmail, PasskeyUser
'two_factor_confirmed_at' => 'datetime',
];
}
public function teams(): BelongsToMany
{
return $this->belongsToMany(Team::class, 'team_members')
->using(TeamMember::class)
->withPivot(['role'])
->withTimestamps();
}
}
+5
View File
@@ -60,6 +60,11 @@ class InviteToTeam extends Notification
? 'register'
: 'teams.invite.create',
['inviteToken' => $invite->plainInviteToken()]
+ (
$user === null
? ['email' => $invite->invited_email]
: []
)
));
}
+3 -1
View File
@@ -67,8 +67,10 @@ class FortifyServiceProvider extends ServiceProvider
'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(),
'inviteToken' => $request->query('inviteToken'),
'email' => $request->query('email'),
]));
Fortify::twoFactorChallengeView(fn () => Inertia::render('auth/TwoFactorChallenge'));
@@ -0,0 +1,32 @@
<?php
use App\Models\Team;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('one_time_secrets', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->nullableMorphs('recipient');
$table->foreignIdFor(Team::class)->nullable()->constrained();
$table->text('secret');
$table->dateTime('expires_at');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('one_time_secrets');
}
};
+27 -19
View File
@@ -203,6 +203,14 @@ settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
overrides:
brace-expansion@>=2.0.0 <2.1.5: ^2.1.5
brace-expansion@>=2.0.0 <2.1.6: ^2.1.6
shell-quote@>=1.8.4 <1.11.0: ^1.11.0
source-map-js@>=1.0.0 <1.2.2: ^1.2.2
tinypool@<2.1.2: ^2.1.2
tinypool@<=2.1.0: ^2.1.1
importers:
.:
@@ -1359,8 +1367,8 @@ packages:
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
brace-expansion@2.1.4:
resolution: {integrity: sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==}
brace-expansion@2.1.7:
resolution: {integrity: sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==}
chai@6.2.2:
resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==}
@@ -1846,8 +1854,8 @@ packages:
scheduler@0.27.0:
resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==}
shell-quote@1.9.0:
resolution: {integrity: sha512-Iov+JwFv/2HcTpcwNMKd8+IWNb8tboQJNQTkAY/LLVK7gGH9jy+LGkVqPxfekHl+yMmiqXszdGWXgkfml7hjqA==}
shell-quote@1.12.0:
resolution: {integrity: sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==}
engines: {node: '>= 0.4'}
siginfo@2.0.0:
@@ -1864,8 +1872,8 @@ packages:
resolution: {integrity: sha512-SO/3iYL5S3W57LLEniscOGPZgOqZUPCx6d3dB+52B80yJ0XstzsC/eV8gnA4tM3MHDrKz+OCFSLNjswdSC+/bA==}
engines: {node: '>=22'}
source-map-js@1.2.1:
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
source-map-js@1.2.2:
resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==}
engines: {node: '>=0.10.0'}
stack-utils@2.0.6:
@@ -1923,8 +1931,8 @@ packages:
resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
engines: {node: '>=12.0.0'}
tinypool@2.1.0:
resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==}
tinypool@2.2.0:
resolution: {integrity: sha512-jBrmx4lYmaC9k/mgPbylxs7kBUxHtD8256up+HjLaDFfXScKJQyil+SWXSvhAtT7XHo+yTVlpB81PGmHP8oLSQ==}
engines: {node: ^20.0.0 || >=22.0.0}
tinyrainbow@3.1.1:
@@ -2493,7 +2501,7 @@ snapshots:
jiti: 2.7.0
lightningcss: 1.32.0
magic-string: 0.30.21
source-map-js: 1.2.1
source-map-js: 1.2.2
tailwindcss: 4.3.3
'@tailwindcss/oxide-android-arm64@4.3.3':
@@ -2735,7 +2743,7 @@ snapshots:
'@vue/shared': 3.5.42
entities: 7.0.1
estree-walker: 2.0.2
source-map-js: 1.2.1
source-map-js: 1.2.2
'@vue/compiler-dom@3.5.42':
dependencies:
@@ -2752,7 +2760,7 @@ snapshots:
estree-walker: 2.0.2
magic-string: 0.30.21
postcss: 8.5.28
source-map-js: 1.2.1
source-map-js: 1.2.2
'@vue/compiler-ssr@3.5.42':
dependencies:
@@ -2929,7 +2937,7 @@ snapshots:
balanced-match@1.0.2: {}
brace-expansion@2.1.4:
brace-expansion@2.1.7:
dependencies:
balanced-match: 1.0.2
@@ -2977,7 +2985,7 @@ snapshots:
dependencies:
chalk: 5.6.2
rxjs: 7.8.2
shell-quote: 1.9.0
shell-quote: 1.12.0
supports-color: 10.2.2
tree-kill: 1.2.2
yargs: 18.0.0
@@ -3215,7 +3223,7 @@ snapshots:
minimatch@9.0.9:
dependencies:
brace-expansion: 2.1.4
brace-expansion: 2.1.7
mrmime@2.0.1: {}
@@ -3234,7 +3242,7 @@ snapshots:
oxfmt@0.64.0(vite-plus@0.3.0(@types/node@22.20.2)(jiti@2.7.0)(typescript@5.9.3)(vite@8.2.2(@types/node@22.20.2)(jiti@2.7.0))):
dependencies:
tinypool: 2.1.0
tinypool: 2.2.0
optionalDependencies:
'@oxfmt/binding-android-arm-eabi': 0.64.0
'@oxfmt/binding-android-arm64': 0.64.0
@@ -3309,7 +3317,7 @@ snapshots:
dependencies:
nanoid: 3.3.18
picocolors: 1.1.1
source-map-js: 1.2.1
source-map-js: 1.2.2
pretty-format@27.5.1:
dependencies:
@@ -3378,7 +3386,7 @@ snapshots:
scheduler@0.27.0:
optional: true
shell-quote@1.9.0: {}
shell-quote@1.12.0: {}
siginfo@2.0.0: {}
@@ -3397,7 +3405,7 @@ snapshots:
is-fullwidth-code-point: 5.1.0
optional: true
source-map-js@1.2.1: {}
source-map-js@1.2.2: {}
stack-utils@2.0.6:
dependencies:
@@ -3447,7 +3455,7 @@ snapshots:
fdir: 6.5.0(picomatch@4.0.7)
picomatch: 4.0.7
tinypool@2.1.0: {}
tinypool@2.2.0: {}
tinyrainbow@3.1.1: {}
+10 -2
View File
@@ -1,7 +1,15 @@
packages:
- '.'
- '.'
ignoreScripts: true
overrides:
brace-expansion@>=2.0.0 <2.1.5: ^2.1.5
brace-expansion@>=2.0.0 <2.1.6: ^2.1.6
shell-quote@>=1.8.4 <1.11.0: ^1.11.0
source-map-js@>=1.0.0 <1.2.2: ^1.2.2
tinypool@<2.1.2: ^2.1.2
tinypool@<=2.1.0: ^2.1.1
publicHoistPattern:
- '@inertiajs/core'
- '@inertiajs/core'
+1 -1
View File
@@ -11,7 +11,7 @@ void createInertiaApp({
title: (title) => (title ? `${title} - ${appName}` : appName),
layout: (name) => {
switch (true) {
case name === 'Welcome':
case name.startsWith('ots/'):
return null;
case name.startsWith('auth/'):
return AuthLayout;
@@ -0,0 +1,24 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { useVModel } from "@vueuse/core"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
defaultValue?: string | number
modelValue?: string | number
}>()
const emits = defineEmits<{
(e: "update:modelValue", payload: string | number): void
}>()
const modelValue = useVModel(props, "modelValue", emits, {
passive: true,
defaultValue: props.defaultValue,
})
</script>
<template>
<textarea v-model="modelValue" :class="cn('flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', props.class)" />
</template>
@@ -0,0 +1 @@
export { default as Textarea } from "./Textarea.vue"
-428
View File
@@ -1,428 +0,0 @@
<script setup lang="ts">
import { Head, Link } from '@inertiajs/vue3';
import { dashboard, login } from '@/routes';
import { register } from '@/routes';
</script>
<template>
<Head title="Welcome">
<link rel="preconnect" href="https://rsms.me/" />
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
</Head>
<div
class="flex min-h-screen flex-col items-center bg-[#FDFDFC] p-6 text-[#1b1b18] lg:justify-center lg:p-8 dark:bg-[#0a0a0a]"
>
<header
class="mb-6 w-full max-w-[335px] text-sm not-has-[nav]:hidden lg:max-w-4xl"
>
<nav class="flex items-center justify-end gap-4">
<Link
v-if="$page.props.auth.user"
:href="dashboard()"
class="inline-block rounded-sm border border-[#19140035] px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#1915014a] dark:border-[#3E3E3A] dark:text-[#EDEDEC] dark:hover:border-[#62605b]"
>
Dashboard
</Link>
<template v-else>
<Link
:href="login()"
class="inline-block rounded-sm border border-transparent px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#19140035] dark:text-[#EDEDEC] dark:hover:border-[#3E3E3A]"
>
Log in
</Link>
<Link
:href="register()"
class="inline-block rounded-sm border border-[#19140035] px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#1915014a] dark:border-[#3E3E3A] dark:text-[#EDEDEC] dark:hover:border-[#62605b]"
>
Register
</Link>
</template>
</nav>
</header>
<div
class="flex w-full items-center justify-center opacity-100 transition-opacity duration-750 lg:grow starting:opacity-0"
>
<main
class="flex w-full max-w-[335px] flex-col-reverse overflow-hidden rounded-lg lg:max-w-4xl lg:flex-row"
>
<div
class="flex-1 rounded-br-lg rounded-bl-lg bg-white p-6 pb-12 text-[13px] leading-[20px] shadow-[inset_0px_0px_0px_1px_rgba(26,26,0,0.16)] lg:rounded-tl-lg lg:rounded-br-none lg:p-20 dark:bg-[#161615] dark:text-[#EDEDEC] dark:shadow-[inset_0px_0px_0px_1px_#fffaed2d]"
>
<h1 class="mb-1 font-medium">Let's get started</h1>
<p class="mb-2 text-[#706f6c] dark:text-[#A1A09A]">
Laravel has an incredibly rich ecosystem. <br />We suggest starting
with the following.
</p>
<ul class="mb-4 flex flex-col lg:mb-6">
<li
class="relative flex items-center gap-4 py-2 before:absolute before:top-1/2 before:bottom-0 before:left-[0.4rem] before:border-l before:border-[#e3e3e0] dark:before:border-[#3E3E3A]"
>
<span class="relative bg-white py-1 dark:bg-[#161615]">
<span
class="flex h-3.5 w-3.5 items-center justify-center rounded-full border border-[#e3e3e0] bg-[#FDFDFC] shadow-[0px_0px_1px_0px_rgba(0,0,0,0.03),0px_1px_2px_0px_rgba(0,0,0,0.06)] dark:border-[#3E3E3A] dark:bg-[#161615]"
>
<span
class="h-1.5 w-1.5 rounded-full bg-[#dbdbd7] dark:bg-[#3E3E3A]"
/>
</span>
</span>
<span>
Read the
<a
href="https://laravel.com/docs"
target="_blank"
class="ml-1 inline-flex items-center space-x-1 font-medium text-[#f53003] underline underline-offset-4 dark:text-[#FF4433]"
>
<span>Documentation</span>
<svg
width="10"
height="11"
viewBox="0 0 10 11"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="h-2.5 w-2.5"
>
<path
d="M7.70833 6.95834V2.79167H3.54167M2.5 8L7.5 3.00001"
stroke="currentColor"
stroke-linecap="square"
/>
</svg>
</a>
</span>
</li>
<li
class="relative flex items-center gap-4 py-2 before:absolute before:top-0 before:bottom-1/2 before:left-[0.4rem] before:border-l before:border-[#e3e3e0] dark:before:border-[#3E3E3A]"
>
<span class="relative bg-white py-1 dark:bg-[#161615]">
<span
class="flex h-3.5 w-3.5 items-center justify-center rounded-full border border-[#e3e3e0] bg-[#FDFDFC] shadow-[0px_0px_1px_0px_rgba(0,0,0,0.03),0px_1px_2px_0px_rgba(0,0,0,0.06)] dark:border-[#3E3E3A] dark:bg-[#161615]"
>
<span
class="h-1.5 w-1.5 rounded-full bg-[#dbdbd7] dark:bg-[#3E3E3A]"
/>
</span>
</span>
<span>
Watch video tutorials at
<a
href="https://laracasts.com"
target="_blank"
class="ml-1 inline-flex items-center space-x-1 font-medium text-[#f53003] underline underline-offset-4 dark:text-[#FF4433]"
>
<span>Laracasts</span>
<svg
width="10"
height="11"
viewBox="0 0 10 11"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="h-2.5 w-2.5"
>
<path
d="M7.70833 6.95834V2.79167H3.54167M2.5 8L7.5 3.00001"
stroke="currentColor"
stroke-linecap="square"
/>
</svg>
</a>
</span>
</li>
</ul>
<ul class="flex gap-3 text-sm leading-normal">
<li>
<a
href="https://cloud.laravel.com"
target="_blank"
class="inline-block rounded-sm border border-black bg-[#1b1b18] px-5 py-1.5 text-sm leading-normal text-white hover:border-black hover:bg-black dark:border-[#eeeeec] dark:bg-[#eeeeec] dark:text-[#1C1C1A] dark:hover:border-white dark:hover:bg-white"
>
Deploy now
</a>
</li>
</ul>
</div>
<div
class="relative -mb-px aspect-[335/364] w-full shrink-0 overflow-hidden rounded-t-lg bg-[#fff2f2] lg:mb-0 lg:-ml-px lg:aspect-auto lg:w-[438px] lg:rounded-t-none lg:rounded-r-lg dark:bg-[#1D0002]"
>
<!-- Laravel Logo -->
<svg
class="w-full max-w-none translate-y-0 text-[#F53003] opacity-100 transition-all duration-750 dark:text-[#F61500] starting:opacity-0 motion-safe:starting:translate-y-6"
viewBox="0 0 438 104"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M17.2036 -3H0V102.197H49.5189V86.7187H17.2036V-3Z"
fill="currentColor"
/>
<path
d="M110.256 41.6337C108.061 38.1275 104.945 35.3731 100.905 33.3681C96.8667 31.3647 92.8016 30.3618 88.7131 30.3618C83.4247 30.3618 78.5885 31.3389 74.201 33.2923C69.8111 35.2456 66.0474 37.928 62.9059 41.3333C59.7643 44.7401 57.3198 48.6726 55.5754 53.1293C53.8287 57.589 52.9572 62.274 52.9572 67.1813C52.9572 72.1925 53.8287 76.8995 55.5754 81.3069C57.3191 85.7173 59.7636 89.6241 62.9059 93.0293C66.0474 96.4361 69.8119 99.1155 74.201 101.069C78.5885 103.022 83.4247 103.999 88.7131 103.999C92.8016 103.999 96.8667 102.997 100.905 100.994C104.945 98.9911 108.061 96.2359 110.256 92.7282V102.195H126.563V32.1642H110.256V41.6337ZM108.76 75.7472C107.762 78.4531 106.366 80.8078 104.572 82.8112C102.776 84.8161 100.606 86.4183 98.0637 87.6206C95.5202 88.823 92.7004 89.4238 89.6103 89.4238C86.5178 89.4238 83.7252 88.823 81.2324 87.6206C78.7388 86.4183 76.5949 84.8161 74.7998 82.8112C73.004 80.8078 71.6319 78.4531 70.6856 75.7472C69.7356 73.0421 69.2644 70.1868 69.2644 67.1821C69.2644 64.1758 69.7356 61.3205 70.6856 58.6154C71.6319 55.9102 73.004 53.5571 74.7998 51.5522C76.5949 49.5495 78.738 47.9451 81.2324 46.7427C83.7252 45.5404 86.5178 44.9396 89.6103 44.9396C92.7012 44.9396 95.5202 45.5404 98.0637 46.7427C100.606 47.9451 102.776 49.5487 104.572 51.5522C106.367 53.5571 107.762 55.9102 108.76 58.6154C109.756 61.3205 110.256 64.1758 110.256 67.1821C110.256 70.1868 109.756 73.0421 108.76 75.7472Z"
fill="currentColor"
/>
<path
d="M242.805 41.6337C240.611 38.1275 237.494 35.3731 233.455 33.3681C229.416 31.3647 225.351 30.3618 221.262 30.3618C215.974 30.3618 211.138 31.3389 206.75 33.2923C202.36 35.2456 198.597 37.928 195.455 41.3333C192.314 44.7401 189.869 48.6726 188.125 53.1293C186.378 57.589 185.507 62.274 185.507 67.1813C185.507 72.1925 186.378 76.8995 188.125 81.3069C189.868 85.7173 192.313 89.6241 195.455 93.0293C198.597 96.4361 202.361 99.1155 206.75 101.069C211.138 103.022 215.974 103.999 221.262 103.999C225.351 103.999 229.416 102.997 233.455 100.994C237.494 98.9911 240.611 96.2359 242.805 92.7282V102.195H259.112V32.1642H242.805V41.6337ZM241.31 75.7472C240.312 78.4531 238.916 80.8078 237.122 82.8112C235.326 84.8161 233.156 86.4183 230.614 87.6206C228.07 88.823 225.251 89.4238 222.16 89.4238C219.068 89.4238 216.275 88.823 213.782 87.6206C211.289 86.4183 209.145 84.8161 207.35 82.8112C205.554 80.8078 204.182 78.4531 203.236 75.7472C202.286 73.0421 201.814 70.1868 201.814 67.1821C201.814 64.1758 202.286 61.3205 203.236 58.6154C204.182 55.9102 205.554 53.5571 207.35 51.5522C209.145 49.5495 211.288 47.9451 213.782 46.7427C216.275 45.5404 219.068 44.9396 222.16 44.9396C225.251 44.9396 228.07 45.5404 230.614 46.7427C233.156 47.9451 235.326 49.5487 237.122 51.5522C238.917 53.5571 240.312 55.9102 241.31 58.6154C242.306 61.3205 242.806 64.1758 242.806 67.1821C242.805 70.1868 242.305 73.0421 241.31 75.7472Z"
fill="currentColor"
/>
<path d="M438 -3H421.694V102.197H438V-3Z" fill="currentColor" />
<path
d="M139.43 102.197H155.735V48.2834H183.712V32.1665H139.43V102.197Z"
fill="currentColor"
/>
<path
d="M324.49 32.1665L303.995 85.794L283.498 32.1665H266.983L293.748 102.197H314.242L341.006 32.1665H324.49Z"
fill="currentColor"
/>
<path
d="M376.571 30.3656C356.603 30.3656 340.797 46.8497 340.797 67.1828C340.797 89.6597 356.094 104 378.661 104C391.29 104 399.354 99.1488 409.206 88.5848L398.189 80.0226C398.183 80.031 389.874 90.9895 377.468 90.9895C363.048 90.9895 356.977 79.3111 356.977 73.269H411.075C413.917 50.1328 398.775 30.3656 376.571 30.3656ZM357.02 61.0967C357.145 59.7487 359.023 43.3761 376.442 43.3761C393.861 43.3761 395.978 59.7464 396.099 61.0967H357.02Z"
fill="currentColor"
/>
</svg>
<!-- 13 -->
<svg
class="relative -mt-[6.6rem] -ml-8 w-[438px] max-w-none [--stroke-color:#1B1B18] lg:ml-0 dark:[--stroke-color:#FF750F]"
viewBox="0 0 440 392"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g
class="text-[#1B1B18] opacity-100 mix-blend-darken transition-all delay-300 duration-750 dark:text-black dark:mix-blend-normal starting:opacity-0"
>
<mask
id="path-1-mask"
maskUnits="userSpaceOnUse"
x="-0.328613"
y="103"
width="338"
height="299"
fill="black"
>
<rect
fill="white"
x="-0.328613"
y="103"
width="338"
height="299"
/>
<path
d="M234.936 400.8C204.136 400.8 178.936 392.4 159.336 375.6C140.136 358.8 130.536 337 130.536 310.2H200.736C200.736 318.2 203.736 324.8 209.736 330C215.736 335.2 223.736 337.8 233.736 337.8C243.336 337.8 251.136 335 257.136 329.4C263.536 323.8 266.736 316.6 266.736 307.8C266.736 299.8 263.936 293.2 258.336 288C252.736 282.8 245.536 280.2 236.736 280.2H199.536V218.4H236.736C243.536 218.4 249.336 216 254.136 211.2C258.936 206.4 261.336 200.4 261.336 193.2C261.336 184.8 258.736 178.2 253.536 173.4C248.336 168.6 241.736 166.2 233.736 166.2C226.536 166.2 220.336 168.4 215.136 172.8C210.336 177.2 207.936 182.8 207.936 189.6H141.336C141.336 164.8 150.136 144.6 167.736 129C185.336 113 207.936 105 235.536 105C263.136 105 285.536 112.2 302.736 126.6C320.336 141 329.136 160 329.136 183.6C329.136 200.8 324.536 214.8 315.336 225.6C306.136 236 294.336 243.2 279.936 247.2C297.136 252 310.736 260.2 320.736 271.8C331.136 283.4 336.336 298 336.336 315.6C336.336 340.4 326.936 360.8 308.136 376.8C289.336 392.8 264.936 400.8 234.936 400.8Z"
/>
<path
d="M26.8714 167.6H1.67139V105.2H94.6714V400.2H26.8714V167.6Z"
/>
</mask>
<path
d="M234.936 400.8C204.136 400.8 178.936 392.4 159.336 375.6C140.136 358.8 130.536 337 130.536 310.2H200.736C200.736 318.2 203.736 324.8 209.736 330C215.736 335.2 223.736 337.8 233.736 337.8C243.336 337.8 251.136 335 257.136 329.4C263.536 323.8 266.736 316.6 266.736 307.8C266.736 299.8 263.936 293.2 258.336 288C252.736 282.8 245.536 280.2 236.736 280.2H199.536V218.4H236.736C243.536 218.4 249.336 216 254.136 211.2C258.936 206.4 261.336 200.4 261.336 193.2C261.336 184.8 258.736 178.2 253.536 173.4C248.336 168.6 241.736 166.2 233.736 166.2C226.536 166.2 220.336 168.4 215.136 172.8C210.336 177.2 207.936 182.8 207.936 189.6H141.336C141.336 164.8 150.136 144.6 167.736 129C185.336 113 207.936 105 235.536 105C263.136 105 285.536 112.2 302.736 126.6C320.336 141 329.136 160 329.136 183.6C329.136 200.8 324.536 214.8 315.336 225.6C306.136 236 294.336 243.2 279.936 247.2C297.136 252 310.736 260.2 320.736 271.8C331.136 283.4 336.336 298 336.336 315.6C336.336 340.4 326.936 360.8 308.136 376.8C289.336 392.8 264.936 400.8 234.936 400.8Z"
fill="currentColor"
/>
<path
d="M26.8714 167.6H1.67139V105.2H94.6714V400.2H26.8714V167.6Z"
fill="currentColor"
/>
<path
d="M234.936 400.8C204.136 400.8 178.936 392.4 159.336 375.6C140.136 358.8 130.536 337 130.536 310.2H200.736C200.736 318.2 203.736 324.8 209.736 330C215.736 335.2 223.736 337.8 233.736 337.8C243.336 337.8 251.136 335 257.136 329.4C263.536 323.8 266.736 316.6 266.736 307.8C266.736 299.8 263.936 293.2 258.336 288C252.736 282.8 245.536 280.2 236.736 280.2H199.536V218.4H236.736C243.536 218.4 249.336 216 254.136 211.2C258.936 206.4 261.336 200.4 261.336 193.2C261.336 184.8 258.736 178.2 253.536 173.4C248.336 168.6 241.736 166.2 233.736 166.2C226.536 166.2 220.336 168.4 215.136 172.8C210.336 177.2 207.936 182.8 207.936 189.6H141.336C141.336 164.8 150.136 144.6 167.736 129C185.336 113 207.936 105 235.536 105C263.136 105 285.536 112.2 302.736 126.6C320.336 141 329.136 160 329.136 183.6C329.136 200.8 324.536 214.8 315.336 225.6C306.136 236 294.336 243.2 279.936 247.2C297.136 252 310.736 260.2 320.736 271.8C331.136 283.4 336.336 298 336.336 315.6C336.336 340.4 326.936 360.8 308.136 376.8C289.336 392.8 264.936 400.8 234.936 400.8Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-1-mask)"
/>
<path
d="M26.8714 167.6H1.67139V105.2H94.6714V400.2H26.8714V167.6Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-1-mask)"
/>
</g>
<g
class="text-[#F3BEC7] opacity-100 transition-all delay-400 duration-750 dark:text-[#4B0600] starting:opacity-0 motion-safe:starting:-translate-x-[26px]"
>
<mask
id="path-2-mask"
maskUnits="userSpaceOnUse"
x="25.3357"
y="103"
width="338"
height="299"
fill="black"
>
<rect
fill="white"
x="25.3357"
y="103"
width="338"
height="299"
/>
<path
d="M260.6 400.8C229.8 400.8 204.6 392.4 185 375.6C165.8 358.8 156.2 337 156.2 310.2H226.4C226.4 318.2 229.4 324.8 235.4 330C241.4 335.2 249.4 337.8 259.4 337.8C269 337.8 276.8 335 282.8 329.4C289.2 323.8 292.4 316.6 292.4 307.8C292.4 299.8 289.6 293.2 284 288C278.4 282.8 271.2 280.2 262.4 280.2H225.2V218.4H262.4C269.2 218.4 275 216 279.8 211.2C284.6 206.4 287 200.4 287 193.2C287 184.8 284.4 178.2 279.2 173.4C274 168.6 267.4 166.2 259.4 166.2C252.2 166.2 246 168.4 240.8 172.8C236 177.2 233.6 182.8 233.6 189.6H167C167 164.8 175.8 144.6 193.4 129C211 113 233.6 105 261.2 105C288.8 105 311.2 112.2 328.4 126.6C346 141 354.8 160 354.8 183.6C354.8 200.8 350.2 214.8 341 225.6C331.8 236 320 243.2 305.6 247.2C322.8 252 336.4 260.2 346.4 271.8C356.8 283.4 362 298 362 315.6C362 340.4 352.6 360.8 333.8 376.8C315 392.8 290.6 400.8 260.6 400.8Z"
/>
<path
d="M52.5357 167.6H27.3357V105.2H120.336V400.2H52.5357V167.6Z"
/>
</mask>
<path
d="M260.6 400.8C229.8 400.8 204.6 392.4 185 375.6C165.8 358.8 156.2 337 156.2 310.2H226.4C226.4 318.2 229.4 324.8 235.4 330C241.4 335.2 249.4 337.8 259.4 337.8C269 337.8 276.8 335 282.8 329.4C289.2 323.8 292.4 316.6 292.4 307.8C292.4 299.8 289.6 293.2 284 288C278.4 282.8 271.2 280.2 262.4 280.2H225.2V218.4H262.4C269.2 218.4 275 216 279.8 211.2C284.6 206.4 287 200.4 287 193.2C287 184.8 284.4 178.2 279.2 173.4C274 168.6 267.4 166.2 259.4 166.2C252.2 166.2 246 168.4 240.8 172.8C236 177.2 233.6 182.8 233.6 189.6H167C167 164.8 175.8 144.6 193.4 129C211 113 233.6 105 261.2 105C288.8 105 311.2 112.2 328.4 126.6C346 141 354.8 160 354.8 183.6C354.8 200.8 350.2 214.8 341 225.6C331.8 236 320 243.2 305.6 247.2C322.8 252 336.4 260.2 346.4 271.8C356.8 283.4 362 298 362 315.6C362 340.4 352.6 360.8 333.8 376.8C315 392.8 290.6 400.8 260.6 400.8Z"
fill="currentColor"
/>
<path
d="M52.5357 167.6H27.3357V105.2H120.336V400.2H52.5357V167.6Z"
fill="currentColor"
/>
<path
d="M260.6 400.8C229.8 400.8 204.6 392.4 185 375.6C165.8 358.8 156.2 337 156.2 310.2H226.4C226.4 318.2 229.4 324.8 235.4 330C241.4 335.2 249.4 337.8 259.4 337.8C269 337.8 276.8 335 282.8 329.4C289.2 323.8 292.4 316.6 292.4 307.8C292.4 299.8 289.6 293.2 284 288C278.4 282.8 271.2 280.2 262.4 280.2H225.2V218.4H262.4C269.2 218.4 275 216 279.8 211.2C284.6 206.4 287 200.4 287 193.2C287 184.8 284.4 178.2 279.2 173.4C274 168.6 267.4 166.2 259.4 166.2C252.2 166.2 246 168.4 240.8 172.8C236 177.2 233.6 182.8 233.6 189.6H167C167 164.8 175.8 144.6 193.4 129C211 113 233.6 105 261.2 105C288.8 105 311.2 112.2 328.4 126.6C346 141 354.8 160 354.8 183.6C354.8 200.8 350.2 214.8 341 225.6C331.8 236 320 243.2 305.6 247.2C322.8 252 336.4 260.2 346.4 271.8C356.8 283.4 362 298 362 315.6C362 340.4 352.6 360.8 333.8 376.8C315 392.8 290.6 400.8 260.6 400.8Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-2-mask)"
/>
<path
d="M52.5357 167.6H27.3357V105.2H120.336V400.2H52.5357V167.6Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-2-mask)"
/>
</g>
<g
class="text-[#F8B803] opacity-100 mix-blend-color transition-all delay-400 duration-750 dark:text-[#391800] dark:mix-blend-hard-light starting:opacity-0 motion-safe:starting:-translate-x-[51px]"
>
<mask
id="path-3-mask"
maskUnits="userSpaceOnUse"
x="51"
y="103"
width="338"
height="299"
fill="black"
>
<rect fill="white" x="51" y="103" width="338" height="299" />
<path
d="M286.264 400.8C255.464 400.8 230.264 392.4 210.664 375.6C191.464 358.8 181.864 337 181.864 310.2H252.064C252.064 318.2 255.064 324.8 261.064 330C267.064 335.2 275.064 337.8 285.064 337.8C294.664 337.8 302.464 335 308.464 329.4C314.864 323.8 318.064 316.6 318.064 307.8C318.064 299.8 315.264 293.2 309.664 288C304.064 282.8 296.864 280.2 288.064 280.2H250.864V218.4H288.064C294.864 218.4 300.664 216 305.464 211.2C310.264 206.4 312.664 200.4 312.664 193.2C312.664 184.8 310.064 178.2 304.864 173.4C299.664 168.6 293.064 166.2 285.064 166.2C277.864 166.2 271.664 168.4 266.464 172.8C261.664 177.2 259.264 182.8 259.264 189.6H192.664C192.664 164.8 201.464 144.6 219.064 129C236.664 113 259.264 105 286.864 105C314.464 105 336.864 112.2 354.064 126.6C371.664 141 380.464 160 380.464 183.6C380.464 200.8 375.864 214.8 366.664 225.6C357.464 236 345.664 243.2 331.264 247.2C348.464 252 362.064 260.2 372.064 271.8C382.464 283.4 387.664 298 387.664 315.6C387.664 340.4 378.264 360.8 359.464 376.8C340.664 392.8 316.264 400.8 286.264 400.8Z"
/>
<path d="M78.2 167.6H53V105.2H146V400.2H78.2V167.6Z" />
</mask>
<path
d="M286.264 400.8C255.464 400.8 230.264 392.4 210.664 375.6C191.464 358.8 181.864 337 181.864 310.2H252.064C252.064 318.2 255.064 324.8 261.064 330C267.064 335.2 275.064 337.8 285.064 337.8C294.664 337.8 302.464 335 308.464 329.4C314.864 323.8 318.064 316.6 318.064 307.8C318.064 299.8 315.264 293.2 309.664 288C304.064 282.8 296.864 280.2 288.064 280.2H250.864V218.4H288.064C294.864 218.4 300.664 216 305.464 211.2C310.264 206.4 312.664 200.4 312.664 193.2C312.664 184.8 310.064 178.2 304.864 173.4C299.664 168.6 293.064 166.2 285.064 166.2C277.864 166.2 271.664 168.4 266.464 172.8C261.664 177.2 259.264 182.8 259.264 189.6H192.664C192.664 164.8 201.464 144.6 219.064 129C236.664 113 259.264 105 286.864 105C314.464 105 336.864 112.2 354.064 126.6C371.664 141 380.464 160 380.464 183.6C380.464 200.8 375.864 214.8 366.664 225.6C357.464 236 345.664 243.2 331.264 247.2C348.464 252 362.064 260.2 372.064 271.8C382.464 283.4 387.664 298 387.664 315.6C387.664 340.4 378.264 360.8 359.464 376.8C340.664 392.8 316.264 400.8 286.264 400.8Z"
fill="currentColor"
/>
<path
d="M78.2 167.6H53V105.2H146V400.2H78.2V167.6Z"
fill="currentColor"
/>
<path
d="M286.264 400.8C255.464 400.8 230.264 392.4 210.664 375.6C191.464 358.8 181.864 337 181.864 310.2H252.064C252.064 318.2 255.064 324.8 261.064 330C267.064 335.2 275.064 337.8 285.064 337.8C294.664 337.8 302.464 335 308.464 329.4C314.864 323.8 318.064 316.6 318.064 307.8C318.064 299.8 315.264 293.2 309.664 288C304.064 282.8 296.864 280.2 288.064 280.2H250.864V218.4H288.064C294.864 218.4 300.664 216 305.464 211.2C310.264 206.4 312.664 200.4 312.664 193.2C312.664 184.8 310.064 178.2 304.864 173.4C299.664 168.6 293.064 166.2 285.064 166.2C277.864 166.2 271.664 168.4 266.464 172.8C261.664 177.2 259.264 182.8 259.264 189.6H192.664C192.664 164.8 201.464 144.6 219.064 129C236.664 113 259.264 105 286.864 105C314.464 105 336.864 112.2 354.064 126.6C371.664 141 380.464 160 380.464 183.6C380.464 200.8 375.864 214.8 366.664 225.6C357.464 236 345.664 243.2 331.264 247.2C348.464 252 362.064 260.2 372.064 271.8C382.464 283.4 387.664 298 387.664 315.6C387.664 340.4 378.264 360.8 359.464 376.8C340.664 392.8 316.264 400.8 286.264 400.8Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-3-mask)"
/>
<path
d="M78.2 167.6H53V105.2H146V400.2H78.2V167.6Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-3-mask)"
/>
</g>
<g
class="text-[#F3BEC7] opacity-100 mix-blend-multiply transition-all delay-400 duration-750 dark:text-[#733000] dark:mix-blend-normal starting:opacity-0 motion-safe:starting:-translate-x-[78px]"
>
<mask
id="path-4-mask"
maskUnits="userSpaceOnUse"
x="76.6643"
y="103"
width="338"
height="299"
fill="black"
>
<rect
fill="white"
x="76.6643"
y="103"
width="338"
height="299"
/>
<path
d="M311.929 400.8C281.129 400.8 255.929 392.4 236.329 375.6C217.129 358.8 207.529 337 207.529 310.2H277.729C277.729 318.2 280.729 324.8 286.729 330C292.729 335.2 300.729 337.8 310.729 337.8C320.329 337.8 328.129 335 334.129 329.4C340.529 323.8 343.729 316.6 343.729 307.8C343.729 299.8 340.929 293.2 335.329 288C329.729 282.8 322.529 280.2 313.729 280.2H276.529V218.4H313.729C320.529 218.4 326.329 216 331.129 211.2C335.929 206.4 338.329 200.4 338.329 193.2C338.329 184.8 335.729 178.2 330.529 173.4C325.329 168.6 318.729 166.2 310.729 166.2C303.529 166.2 297.329 168.4 292.129 172.8C287.329 177.2 284.929 182.8 284.929 189.6H218.329C218.329 164.8 227.129 144.6 244.729 129C262.329 113 284.929 105 312.529 105C340.129 105 362.529 112.2 379.729 126.6C397.329 141 406.129 160 406.129 183.6C406.129 200.8 401.529 214.8 392.329 225.6C383.129 236 371.329 243.2 356.929 247.2C374.129 252 387.729 260.2 397.729 271.8C408.129 283.4 413.329 298 413.329 315.6C413.329 340.4 403.929 360.8 385.129 376.8C366.329 392.8 341.929 400.8 311.929 400.8Z"
/>
<path
d="M103.864 167.6H78.6643V105.2H171.664V400.2H103.864V167.6Z"
/>
</mask>
<path
d="M311.929 400.8C281.129 400.8 255.929 392.4 236.329 375.6C217.129 358.8 207.529 337 207.529 310.2H277.729C277.729 318.2 280.729 324.8 286.729 330C292.729 335.2 300.729 337.8 310.729 337.8C320.329 337.8 328.129 335 334.129 329.4C340.529 323.8 343.729 316.6 343.729 307.8C343.729 299.8 340.929 293.2 335.329 288C329.729 282.8 322.529 280.2 313.729 280.2H276.529V218.4H313.729C320.529 218.4 326.329 216 331.129 211.2C335.929 206.4 338.329 200.4 338.329 193.2C338.329 184.8 335.729 178.2 330.529 173.4C325.329 168.6 318.729 166.2 310.729 166.2C303.529 166.2 297.329 168.4 292.129 172.8C287.329 177.2 284.929 182.8 284.929 189.6H218.329C218.329 164.8 227.129 144.6 244.729 129C262.329 113 284.929 105 312.529 105C340.129 105 362.529 112.2 379.729 126.6C397.329 141 406.129 160 406.129 183.6C406.129 200.8 401.529 214.8 392.329 225.6C383.129 236 371.329 243.2 356.929 247.2C374.129 252 387.729 260.2 397.729 271.8C408.129 283.4 413.329 298 413.329 315.6C413.329 340.4 403.929 360.8 385.129 376.8C366.329 392.8 341.929 400.8 311.929 400.8Z"
fill="currentColor"
/>
<path
d="M103.864 167.6H78.6643V105.2H171.664V400.2H103.864V167.6Z"
fill="currentColor"
/>
<path
d="M311.929 400.8C281.129 400.8 255.929 392.4 236.329 375.6C217.129 358.8 207.529 337 207.529 310.2H277.729C277.729 318.2 280.729 324.8 286.729 330C292.729 335.2 300.729 337.8 310.729 337.8C320.329 337.8 328.129 335 334.129 329.4C340.529 323.8 343.729 316.6 343.729 307.8C343.729 299.8 340.929 293.2 335.329 288C329.729 282.8 322.529 280.2 313.729 280.2H276.529V218.4H313.729C320.529 218.4 326.329 216 331.129 211.2C335.929 206.4 338.329 200.4 338.329 193.2C338.329 184.8 335.729 178.2 330.529 173.4C325.329 168.6 318.729 166.2 310.729 166.2C303.529 166.2 297.329 168.4 292.129 172.8C287.329 177.2 284.929 182.8 284.929 189.6H218.329C218.329 164.8 227.129 144.6 244.729 129C262.329 113 284.929 105 312.529 105C340.129 105 362.529 112.2 379.729 126.6C397.329 141 406.129 160 406.129 183.6C406.129 200.8 401.529 214.8 392.329 225.6C383.129 236 371.329 243.2 356.929 247.2C374.129 252 387.729 260.2 397.729 271.8C408.129 283.4 413.329 298 413.329 315.6C413.329 340.4 403.929 360.8 385.129 376.8C366.329 392.8 341.929 400.8 311.929 400.8Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-4-mask)"
/>
<path
d="M103.864 167.6H78.6643V105.2H171.664V400.2H103.864V167.6Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-4-mask)"
/>
</g>
<g
class="text-[#F3BEC7] opacity-100 mix-blend-hard-light transition-all delay-400 duration-750 dark:text-[#4B0600] starting:opacity-0 motion-safe:starting:-translate-x-[102px]"
>
<mask
id="path-5-mask"
maskUnits="userSpaceOnUse"
x="102.329"
y="103"
width="338"
height="299"
fill="black"
>
<rect
fill="white"
x="102.329"
y="103"
width="338"
height="299"
/>
<path
d="M337.593 400.8C306.793 400.8 281.593 392.4 261.993 375.6C242.793 358.8 233.193 337 233.193 310.2H303.393C303.393 318.2 306.393 324.8 312.393 330C318.393 335.2 326.393 337.8 336.393 337.8C345.993 337.8 353.793 335 359.793 329.4C366.193 323.8 369.393 316.6 369.393 307.8C369.393 299.8 366.593 293.2 360.993 288C355.393 282.8 348.193 280.2 339.393 280.2H302.193V218.4H339.393C346.193 218.4 351.993 216 356.793 211.2C361.593 206.4 363.993 200.4 363.993 193.2C363.993 184.8 361.393 178.2 356.193 173.4C350.993 168.6 344.393 166.2 336.393 166.2C329.193 166.2 322.993 168.4 317.793 172.8C312.993 177.2 310.593 182.8 310.593 189.6H243.993C243.993 164.8 252.793 144.6 270.393 129C287.993 113 310.593 105 338.193 105C365.793 105 388.193 112.2 405.393 126.6C422.993 141 431.793 160 431.793 183.6C431.793 200.8 427.193 214.8 417.993 225.6C408.793 236 396.993 243.2 382.593 247.2C399.793 252 413.393 260.2 423.393 271.8C433.793 283.4 438.993 298 438.993 315.6C438.993 340.4 429.593 360.8 410.793 376.8C391.993 392.8 367.593 400.8 337.593 400.8Z"
/>
<path
d="M129.529 167.6H104.329V105.2H197.329V400.2H129.529V167.6Z"
/>
</mask>
<path
d="M337.593 400.8C306.793 400.8 281.593 392.4 261.993 375.6C242.793 358.8 233.193 337 233.193 310.2H303.393C303.393 318.2 306.393 324.8 312.393 330C318.393 335.2 326.393 337.8 336.393 337.8C345.993 337.8 353.793 335 359.793 329.4C366.193 323.8 369.393 316.6 369.393 307.8C369.393 299.8 366.593 293.2 360.993 288C355.393 282.8 348.193 280.2 339.393 280.2H302.193V218.4H339.393C346.193 218.4 351.993 216 356.793 211.2C361.593 206.4 363.993 200.4 363.993 193.2C363.993 184.8 361.393 178.2 356.193 173.4C350.993 168.6 344.393 166.2 336.393 166.2C329.193 166.2 322.993 168.4 317.793 172.8C312.993 177.2 310.593 182.8 310.593 189.6H243.993C243.993 164.8 252.793 144.6 270.393 129C287.993 113 310.593 105 338.193 105C365.793 105 388.193 112.2 405.393 126.6C422.993 141 431.793 160 431.793 183.6C431.793 200.8 427.193 214.8 417.993 225.6C408.793 236 396.993 243.2 382.593 247.2C399.793 252 413.393 260.2 423.393 271.8C433.793 283.4 438.993 298 438.993 315.6C438.993 340.4 429.593 360.8 410.793 376.8C391.993 392.8 367.593 400.8 337.593 400.8Z"
fill="currentColor"
/>
<path
d="M129.529 167.6H104.329V105.2H197.329V400.2H129.529V167.6Z"
fill="currentColor"
/>
<path
d="M337.593 400.8C306.793 400.8 281.593 392.4 261.993 375.6C242.793 358.8 233.193 337 233.193 310.2H303.393C303.393 318.2 306.393 324.8 312.393 330C318.393 335.2 326.393 337.8 336.393 337.8C345.993 337.8 353.793 335 359.793 329.4C366.193 323.8 369.393 316.6 369.393 307.8C369.393 299.8 366.593 293.2 360.993 288C355.393 282.8 348.193 280.2 339.393 280.2H302.193V218.4H339.393C346.193 218.4 351.993 216 356.793 211.2C361.593 206.4 363.993 200.4 363.993 193.2C363.993 184.8 361.393 178.2 356.193 173.4C350.993 168.6 344.393 166.2 336.393 166.2C329.193 166.2 322.993 168.4 317.793 172.8C312.993 177.2 310.593 182.8 310.593 189.6H243.993C243.993 164.8 252.793 144.6 270.393 129C287.993 113 310.593 105 338.193 105C365.793 105 388.193 112.2 405.393 126.6C422.993 141 431.793 160 431.793 183.6C431.793 200.8 427.193 214.8 417.993 225.6C408.793 236 396.993 243.2 382.593 247.2C399.793 252 413.393 260.2 423.393 271.8C433.793 283.4 438.993 298 438.993 315.6C438.993 340.4 429.593 360.8 410.793 376.8C391.993 392.8 367.593 400.8 337.593 400.8Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-5-mask)"
/>
<path
d="M129.529 167.6H104.329V105.2H197.329V400.2H129.529V167.6Z"
stroke="var(--stroke-color)"
stroke-width="2.4"
mask="url(#path-5-mask)"
/>
</g>
</svg>
<div
class="absolute inset-0 rounded-t-lg shadow-[inset_0px_0px_0px_1px_rgba(26,26,0,0.16)] lg:rounded-t-none lg:rounded-r-lg dark:shadow-[inset_0px_0px_0px_1px_#fffaed2d]"
></div>
</div>
</main>
</div>
<div class="hidden h-14.5 lg:block"></div>
</div>
</template>
+31 -16
View File
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { Form, Head } from '@inertiajs/vue3';
import InputError from '@/components/InputError.vue';
import PasswordInput from '@/components/PasswordInput.vue';
@@ -12,6 +12,8 @@ import { store } from '@/routes/register';
defineProps<{
passwordRules: string;
inviteToken?: string;
email?: string;
}>();
defineOptions({
@@ -26,23 +28,23 @@ defineOptions({
<Head title="Register" />
<Form
v-bind="store.form()"
:reset-on-success="['password', 'password_confirmation']"
v-slot="{ errors, processing }"
:reset-on-success="['password', 'password_confirmation']"
class="flex flex-col gap-6"
v-bind="store.form()"
>
<div class="grid gap-6">
<div class="grid gap-2">
<Label for="name">Name</Label>
<Input
id="name"
type="text"
required
autofocus
:tabindex="1"
autocomplete="name"
autofocus
name="name"
placeholder="Full name"
required
type="text"
/>
<InputError :message="errors.name" />
</div>
@@ -51,12 +53,14 @@ defineOptions({
<Label for="email">Email address</Label>
<Input
id="email"
type="email"
required
:model-value="email"
:readonly="email !== null"
:tabindex="2"
autocomplete="email"
name="email"
placeholder="email@example.com"
required
type="email"
/>
<InputError :message="errors.email" />
</div>
@@ -65,12 +69,12 @@ defineOptions({
<Label for="password">Password</Label>
<PasswordInput
id="password"
required
:passwordrules="passwordRules"
:tabindex="3"
autocomplete="new-password"
name="password"
placeholder="Password"
:passwordrules="passwordRules"
required
/>
<InputError :message="errors.password" />
</div>
@@ -79,22 +83,33 @@ defineOptions({
<Label for="password_confirmation">Confirm password</Label>
<PasswordInput
id="password_confirmation"
required
:passwordrules="passwordRules"
:tabindex="4"
autocomplete="new-password"
name="password_confirmation"
placeholder="Confirm password"
:passwordrules="passwordRules"
required
/>
<InputError :message="errors.password_confirmation" />
</div>
<div class="grid gap-2">
<PasswordInput
id="invite_token"
:model-value="inviteToken"
name="invite_token"
type="hidden"
/>
<InputError :message="errors.invite_token" />
</div>
<InputError :message="errors.require_2fa" />
<Button
type="submit"
class="mt-2 w-full"
tabindex="5"
:disabled="processing"
class="mt-2 w-full"
data-test="register-user-button"
tabindex="5"
type="submit"
>
<Spinner v-if="processing" />
Create account
@@ -105,8 +120,8 @@ defineOptions({
Already have an account?
<TextLink
:href="login()"
class="underline underline-offset-4"
:tabindex="6"
class="underline underline-offset-4"
>Log in</TextLink
>
</div>
+74
View File
@@ -0,0 +1,74 @@
<script lang="ts" setup>
import otsRoutes from '@/routes/ots';
import {Save} from '@lucide/vue';
import {Head, useForm} from '@inertiajs/vue3';
import {Button} from '@/components/ui/button';
import {Label} from '@/components/ui/label';
import InputError from '@/components/InputError.vue';
import {Card, CardContent} from '@/components/ui/card';
import {Textarea} from '@/components/ui/textarea';
import {Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue} from "@/components/ui/select";
const props = defineProps<{
durations: {
value: number,
label: string
}[],
}>();
const form = useForm({
secret: '',
duration: props.durations[props.durations.length - 1].value
});
function submit(): void {
form.submit(otsRoutes.store());
}
</script>
<template>
<div class="flex flex-col justify-center p-16">
<Head title="OTS"/>
<Card class="w-full">
<CardContent>
<form class="grid w-full gap-5 py-4" @submit.prevent="submit">
<div class="grid grid-cols-2 items-start gap-4">
<div class="col-span-2 grid items-start gap-3">
<Label for="secret">Secret</Label>
<Textarea
id="secret"
v-model="form.secret"
:rows="10"
autofocus
name="secret"
/>
<InputError :message="form.errors.secret"/>
</div>
<div class="grid items-start gap-3">
<Label for="duration">Duration</Label>
<Select v-model="form.duration">
<SelectTrigger class="w-full">
<SelectValue placeholder="Select expires duration" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem v-for="duration in durations" :value="duration.value">
{{ duration.label }}
</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
<InputError :message="form.errors.duration"/>
</div>
</div>
<div class="flex w-full justify-end">
<Button :disabled="form.processing" class="w-fit" type="submit">
<component :is="Save"/>
Erstellen
</Button>
</div>
</form>
</CardContent>
</Card>
</div>
</template>
+31
View File
@@ -0,0 +1,31 @@
<script lang="ts" setup>
import { Head } from '@inertiajs/vue3';
import { Card, CardContent, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
const props = defineProps<{
otsLink: string;
}>();
const copyLink = async () => {
await navigator.clipboard.writeText(props.otsLink);
};
</script>
<template>
<div class="flex flex-col justify-center p-16">
<Head title="OTS" />
<Card class="w-full">
<CardContent>
<CardTitle class="mb-8 text-center text-2xl">
<h1>Erstellt!</h1>
</CardTitle>
<div class="flex gap-4">
<Input :model-value="otsLink" name="ots_link" readonly />
<Button variant="secondary" @click="copyLink">Kopieren</Button>
</div>
</CardContent>
</Card>
</div>
</template>
+72
View File
@@ -0,0 +1,72 @@
<script lang="ts" setup>
import otsRoutes from '@/routes/ots';
import { Head, useHttp } from '@inertiajs/vue3';
import type { OTS } from '@/types/models';
import {
Card,
CardAction,
CardContent,
CardDescription,
CardTitle,
} from '@/components/ui/card';
import { Textarea } from '@/components/ui/textarea';
import { ref } from 'vue';
import { Button } from '@/components/ui/button';
const props = defineProps<{
oneTimeSecretId: string;
}>();
const oneTimeSecret = ref<OTS | null>(null);
const loadingSecret = ref<boolean>(false);
const confirmShow = async () => {
loadingSecret.value = true;
try {
oneTimeSecret.value = await useHttp<{}, { secret: string }>().submit(
otsRoutes.reveal({
oneTimeSecret: props.oneTimeSecretId,
}),
);
} catch (error) {
console.error(error);
} finally {
loadingSecret.value = false;
}
};
</script>
<template>
<div class="flex flex-col justify-center p-16">
<Head title="OTS" />
<Card class="w-full">
<CardContent v-if="oneTimeSecret">
<Textarea
v-model="oneTimeSecret.secret"
:rows="10"
name="secret"
readonly
/>
</CardContent>
<CardContent v-else>
<CardTitle class="text-center text-xl">
Möchtest du das Secret Anzeigen?
</CardTitle>
<CardDescription class="text-md mb-8 text-center">
Nach dem Anzeigen des Secrets wird es unwiderruflich gelöscht und kann
nicht noch einmal angezeigt werden!
</CardDescription>
<CardAction class="justify-self-center">
<Button
:disabled="loadingSecret"
class="cursor-pointer"
variant="destructive"
@click="confirmShow"
>
Anzeigen
</Button>
</CardAction>
</CardContent>
</Card>
</div>
</template>
+45 -12
View File
@@ -1,6 +1,6 @@
<script lang="ts" setup>
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 InputError from '@/components/InputError.vue';
import { Card, CardContent } from '@/components/ui/card';
@@ -13,7 +13,9 @@ import {
TableRow,
} from '@/components/ui/table';
import { Button } from '@/components/ui/button';
import { Pencil, Trash } from '@lucide/vue';
import { Pencil, Plus, Trash } from '@lucide/vue';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
const props = defineProps<{
team: Team;
@@ -71,9 +73,9 @@ function revokeInvite(invite: TeamInvite): void {
</TableRow>
<TableRow>
<TableCell class="font-bold">Erfordert 2FA:</TableCell>
<TableCell>{{
team.multi_factor_required ? 'Ja' : 'Nein'
}}</TableCell>
<TableCell
>{{ team.multi_factor_required ? 'Ja' : 'Nein' }}
</TableCell>
</TableRow>
<TableRow>
<TableCell class="font-bold">Erstellt am:</TableCell>
@@ -100,9 +102,9 @@ function revokeInvite(invite: TeamInvite): void {
<TableRow v-for="member in team.members" :key="member.email">
<TableCell>{{ member.name }}</TableCell>
<TableCell>{{ member.email }}</TableCell>
<TableCell>{{
member.has_multi_factor ? 'Ja' : 'Nein'
}}</TableCell>
<TableCell
>{{ member.has_multi_factor ? 'Ja' : 'Nein' }}
</TableCell>
<TableCell>{{ member.role }}</TableCell>
<TableCell>{{ member.joined_at }}</TableCell>
</TableRow>
@@ -112,7 +114,38 @@ function revokeInvite(invite: TeamInvite): void {
</Card>
<Card v-if="teamInvites" class="mb-8 w-full">
<CardContent>
<h2 class="text-lg font-semibold">Ausstehende Invites</h2>
<div class="flex justify-between">
<h2 class="text-lg font-semibold">Ausstehende Invites</h2>
<Card class="b-2 border-neutral-500">
<CardContent>
<Form
v-slot="{ errors, processing }"
:action="teamRoutes.invite.invite({ team: team.slug })"
class="flex items-end justify-end gap-2"
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>
<TableHeader>
@@ -129,11 +162,11 @@ function revokeInvite(invite: TeamInvite): void {
<TableCell>{{ invite.invitedAt }}</TableCell>
<TableCell>
<Button
:aria-label="`Einladung für ${invite.invitedEmail} widerrufen`"
:disabled="revokeForm.processing"
size="icon"
type="button"
variant="ghost"
size="icon"
:disabled="revokeForm.processing"
:aria-label="`Einladung für ${invite.invitedEmail} widerrufen`"
@click="revokeInvite(invite)"
>
<Trash :size="18" />
@@ -49,6 +49,7 @@ const submit = () => form.post(teamRoutes.invite.store().url);
/>
<InputError :message="form.errors.inviteToken" />
</div>
<InputError :message="(form.errors as any).require_2fa" />
<div class="flex w-full justify-end">
<Button :disabled="form.processing" type="submit"
>Team Beitreten</Button
+4
View File
@@ -6,6 +6,10 @@ export interface Team {
created_at: string;
}
export interface OTS {
secret: string;
}
export type TeamMemberRole = 'owner' | 'admin' | 'member';
export interface User {
+2 -5
View File
@@ -1,8 +1,5 @@
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use App\Console\Commands\DeleteExpiredOneTimeSecrets;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
Schedule::command(DeleteExpiredOneTimeSecrets::class)->hourly();
+13 -3
View File
@@ -1,11 +1,13 @@
<?php
use App\Http\Controllers\OTSController;
use App\Http\Controllers\TeamController;
use App\Http\Controllers\TeamInviteAcceptController;
use App\Http\Controllers\TeamInviteController;
use App\Models\Team;
use Illuminate\Support\Facades\Route;
Route::inertia('/', 'Welcome')->name('home');
Route::redirect('/', '/ots')->name('home');
Route::middleware(['auth'])->group(function () {
Route::inertia('dashboard', 'Dashboard')->name('dashboard');
@@ -14,8 +16,8 @@ Route::middleware(['auth'])->group(function () {
Route::name('invite.')->group(function () {
Route::get('invite/accept', [TeamInviteAcceptController::class, 'create'])->name('create');
Route::post('invite/accept', [TeamInviteAcceptController::class, 'store'])->name('store');
Route::post('{team:slug}/invite', [TeamController::class, 'invite'])->name('invite');
Route::post('{team:slug}/invite/revoke', [TeamController::class, 'revokeInvite'])->name('revoke')->can('manage', 'team');
Route::post('{team:slug}/invite', [TeamInviteController::class, 'store'])->name('invite');
Route::post('{team:slug}/invite/revoke', [TeamInviteController::class, 'destroy'])->name('revoke')->can('manage', 'team');
});
Route::get('/', 'index')->name('index');
@@ -30,4 +32,12 @@ Route::middleware(['auth'])->group(function () {
});
Route::name('ots.')->prefix('ots')->group(function () {
Route::get('/', [OTSController::class, 'create'])->name('create');
Route::get('created', [OTSController::class, 'created'])->name('created');
Route::post('/', [OTSController::class, 'store'])->name('store');
Route::get('/{oneTimeSecret}', [OTSController::class, 'show'])->name('show');
Route::post('/{oneTimeSecret}', [OTSController::class, 'reveal'])->name('reveal');
});
require __DIR__.'/settings.php';