Skip to content

Commit

Permalink
Login two factor rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Aug 16, 2024
1 parent efea5cc commit 38aade7
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 39 deletions.
56 changes: 21 additions & 35 deletions resources/views/auth/login-two-factor.blade.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
<div class="relative flex min-h-screen shrink-0 justify-center md:px-12 lg:px-0">
<div
class="relative z-10 flex flex-1 flex-col bg-white px-4 py-10 shadow-2xl sm:justify-center md:flex-none md:px-28">
<main class="mx-auto w-full max-w-md sm:px-4 md:w-96 md:max-w-sm md:px-0">
<div class="flex justify-center">
<a href="#" class="-m-1.5 p-1.5">
<span class="sr-only">{{ config('app.name') }}</span>
<span class="text-3xl font-bold xs:text-2xl">{{ config('app.name') }}</span>
</a>
</div>
<h2 class="mt-20 text-lg font-semibold text-gray-900 text-center">
{{ __('Authenticate with your Authentication code') }}
</h2>
{{ $this->resend() }}
<x-filament-panels::page.simple>
@if (filament()->hasRegistration())
<x-slot name="subheading">
{{ __('filament-panels::pages/auth/login.actions.register.before') }}

<form method="POST" action="{{ route('two-factor.login') }}" class="space-y-8">
{{ $this->registerAction }}
</x-slot>
@endif
<h2 class="mt-20 text-lg font-semibold text-gray-900 text-center">
{{ __('Authenticate with your Authentication code') }}
</h2>

<form method="POST" action="{{ route('two-factor.login') }}" class="space-y-8">

@csrf
{{ $this->form }}
@csrf
{{ $this->form }}

<div class="flex items-center justify-between">
<x-filament::button color="secondary" class="w-full" type="button" tag="a" outlined
href="{{ route('login') }}">
{{ __('Cancel') }}
</x-filament::button>
<x-filament::button type="submit" class="w-full" color="info">
{{ __('Login') }}
</x-filament::button>
</div>
</form>

</main>
</div>
<div class="hidden sm:contents lg:relative lg:block lg:flex-1">
<img class="absolute inset-0 h-full w-full object-cover" src="/img/background-auth.jpg" alt=""
unoptimized />
</div>
</div>
<div class="flex items-center justify-between mt-6">
<x-filament::button type="submit" class="w-full" color="info">
{{ __('Login') }}
</x-filament::button>
</div>
</form>
</x-filament-panels::page.simple>
41 changes: 37 additions & 4 deletions resources/views/layouts/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,44 @@
'subheading' => null,
])

<main @class([''])>
{{ $slot }}
</main>
<div class="fi-simple-layout flex min-h-screen flex-col items-center">
@if (($hasTopbar ?? true) && filament()->auth()->check())
<div
class="absolute end-0 top-0 flex h-16 items-center gap-x-4 pe-4 md:pe-6 lg:pe-8"
>
@if (filament()->hasDatabaseNotifications())
@livewire(Filament\Livewire\DatabaseNotifications::class, ['lazy' => true])
@endif

<x-filament-panels::user-menu />
</div>
@endif

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::FOOTER, scopes: $livewire->getRenderHookScopes()) }}
<div
class="fi-simple-main-ctn flex w-full flex-grow items-center justify-center"
>
<main
@class([
'fi-simple-main my-16 w-full bg-white px-6 py-12 shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10 sm:rounded-xl sm:px-12',
match ($maxWidth ?? null) {
MaxWidth::ExtraSmall, 'xs' => 'sm:max-w-xs',
MaxWidth::Small, 'sm' => 'sm:max-w-sm',
MaxWidth::Medium, 'md' => 'sm:max-w-md',
MaxWidth::ExtraLarge, 'xl' => 'sm:max-w-xl',
MaxWidth::TwoExtraLarge, '2xl' => 'sm:max-w-2xl',
MaxWidth::ThreeExtraLarge, '3xl' => 'sm:max-w-3xl',
MaxWidth::FourExtraLarge, '4xl' => 'sm:max-w-4xl',
MaxWidth::FiveExtraLarge, '5xl' => 'sm:max-w-5xl',
MaxWidth::SixExtraLarge, '6xl' => 'sm:max-w-6xl',
MaxWidth::SevenExtraLarge, '7xl' => 'sm:max-w-7xl',
default => 'sm:max-w-lg',
},
])
>
{{ $slot }}
</main>
</div>

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::FOOTER, scopes: $livewire->getRenderHookScopes()) }}
</div>
</x-filament-panels::layout.base>

0 comments on commit 38aade7

Please sign in to comment.