1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Refactor authentication view in billing portal v3

This commit is contained in:
Benjamin Beganović 2024-02-09 17:53:34 +01:00
parent 05f8e2a72c
commit a5672187c4

View File

@ -5,11 +5,38 @@
@endcomponent @endcomponent
@endif @endif
@if($state['code'] === false) <div class="my-4">
<form wire:submit="authenticate"> <h1 class="text-3xl font-medium">{{ ctrans('texts.contact') }}</h1>
</div>
@if($state['initial_completed'] === false)
<form wire:submit="initial">
@csrf
<label for="email_address">
<span class="input-label">{{ ctrans('texts.email_address') }}</span>
<input wire:model="email" type="email" class="input w-full" />
@error('email')
<p class="validation validation-fail block w-full" role="alert">
{{ $message }}
</p>
@enderror
</label>
<button
type="submit"
class="button button-block bg-primary text-white mt-4">
{{ ctrans('texts.next') }}
</button>
</form>
@endif
@if($state['login_form'])
<form wire:submit="handlePassword" class="space-y-3">
@csrf @csrf
<label for="email_address"> <div>
<span class="input-label">{{ ctrans('texts.email_address') }}</span> <span class="input-label">{{ ctrans('texts.email_address') }}</span>
<input wire:model="email" type="email" class="input w-full" /> <input wire:model="email" type="email" class="input w-full" />
@ -18,7 +45,41 @@
{{ $message }} {{ $message }}
</p> </p>
@enderror @enderror
</label> </div>
<div>
<span class="input-label">{{ ctrans('texts.password') }}</span>
<input wire:model="password" type="password" class="input w-full" />
@error('password')
<p class="validation validation-fail block w-full" role="alert">
{{ $message }}
</p>
@enderror
</div>
<button
type="submit"
class="button button-block bg-primary text-white mt-4">
{{ ctrans('texts.next') }}
</button>
</form>
@endif
@if($state['otp_form'])
<form wire:submit="handleOtp" class="space-y-3">
@csrf
<div>
<span class="input-label">{{ ctrans('texts.code') }}</span>
<input wire:model="otp" type="text" class="input w-full" />
@error('otp')
<p class="validation validation-fail block w-full" role="alert">
{{ $message }}
</p>
@enderror
</div>
<button <button
type="submit" type="submit"
@ -26,7 +87,5 @@
{{ ctrans('texts.next') }} {{ ctrans('texts.next') }}
</button> </button>
</form> </form>
@else
<p>We have sent a code to {{ $email }} enter this code to proceed.</p>
@endif @endif
</div> </div>