|
20 | 20 |
|
21 | 21 | <!-- Login Card --> |
22 | 22 | <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl overflow-hidden"> |
23 | | - <div class="px-5 py-5 sm:px-8 sm:py-6"> |
| 23 | + <div |
| 24 | + x-data="loginMode" |
| 25 | + x-on:use-password-login.stop="usePassword()" |
| 26 | + data-prefers-password="{{ $errors->any() ? '1' : '0' }}" |
| 27 | + class="px-5 py-5 sm:px-8 sm:py-6" |
| 28 | + > |
24 | 29 | @if($errors->any()) |
25 | 30 | <div class="mb-4 p-4 rounded-lg bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-700"> |
26 | 31 | <div class="flex items-start"> |
|
37 | 42 | </div> |
38 | 43 | @endif |
39 | 44 |
|
40 | | - <!-- Login Form --> |
41 | | - <form method="POST" action="{{ route('login') }}" class="space-y-6"> |
42 | | - @csrf |
43 | | - |
44 | | - <!-- Username/Email Field --> |
45 | | - <div> |
46 | | - <label for="username" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> |
47 | | - Username or Email |
48 | | - </label> |
49 | | - <div class="relative"> |
50 | | - <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> |
51 | | - <i class="fas fa-user text-gray-400"></i> |
| 45 | + <div x-show="!showPassword" x-cloak> |
| 46 | + @include('partials.passkey-authenticate') |
| 47 | + |
| 48 | + <button |
| 49 | + type="button" |
| 50 | + x-show="supported" |
| 51 | + @click="usePassword()" |
| 52 | + class="mt-4 inline-flex items-center text-sm font-medium text-blue-600 transition hover:text-blue-500 dark:text-blue-400" |
| 53 | + > |
| 54 | + Sign in with password instead |
| 55 | + <i class="fas fa-arrow-right ml-2"></i> |
| 56 | + </button> |
| 57 | + </div> |
| 58 | + |
| 59 | + <div x-show="showPassword" x-cloak> |
| 60 | + <button |
| 61 | + type="button" |
| 62 | + x-show="supported" |
| 63 | + @click="usePasskey()" |
| 64 | + class="mb-4 inline-flex items-center text-sm font-medium text-blue-600 transition hover:text-blue-500 dark:text-blue-400" |
| 65 | + > |
| 66 | + <i class="fas fa-arrow-left mr-2"></i> |
| 67 | + Sign in with passkey |
| 68 | + </button> |
| 69 | + |
| 70 | + <!-- Login Form --> |
| 71 | + <form method="POST" action="{{ route('login') }}" class="space-y-6"> |
| 72 | + @csrf |
| 73 | + |
| 74 | + <!-- Username/Email Field --> |
| 75 | + <div> |
| 76 | + <label for="username" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> |
| 77 | + Username or Email |
| 78 | + </label> |
| 79 | + <div class="relative"> |
| 80 | + <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> |
| 81 | + <i class="fas fa-user text-gray-400"></i> |
| 82 | + </div> |
| 83 | + <input |
| 84 | + id="username" |
| 85 | + type="text" |
| 86 | + name="username" |
| 87 | + value="{{ old('username') }}" |
| 88 | + required |
| 89 | + autofocus |
| 90 | + class="block w-full pl-10 pr-3 py-3 border border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition @error('username') border-red-500 @enderror" |
| 91 | + placeholder="Enter your username or email" |
| 92 | + > |
52 | 93 | </div> |
53 | | - <input |
54 | | - id="username" |
55 | | - type="text" |
56 | | - name="username" |
57 | | - value="{{ old('username') }}" |
58 | | - required |
59 | | - autofocus |
60 | | - class="block w-full pl-10 pr-3 py-3 border border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition @error('username') border-red-500 @enderror" |
61 | | - placeholder="Enter your username or email" |
62 | | - > |
| 94 | + @error('username') |
| 95 | + <p class="mt-2 text-sm text-red-600">{{ $message }}</p> |
| 96 | + @enderror |
63 | 97 | </div> |
64 | | - @error('username') |
65 | | - <p class="mt-2 text-sm text-red-600">{{ $message }}</p> |
66 | | - @enderror |
67 | | - </div> |
68 | 98 |
|
69 | | - <!-- Password Field --> |
70 | | - <div> |
71 | | - <label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> |
72 | | - Password |
73 | | - </label> |
74 | | - <div class="relative"> |
75 | | - <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> |
76 | | - <i class="fas fa-lock text-gray-400"></i> |
| 99 | + <!-- Password Field --> |
| 100 | + <div> |
| 101 | + <label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> |
| 102 | + Password |
| 103 | + </label> |
| 104 | + <div class="relative"> |
| 105 | + <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> |
| 106 | + <i class="fas fa-lock text-gray-400"></i> |
| 107 | + </div> |
| 108 | + <input |
| 109 | + id="password" |
| 110 | + type="password" |
| 111 | + name="password" |
| 112 | + required |
| 113 | + class="block w-full pl-10 pr-10 py-3 border border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition @error('password') border-red-500 @enderror" |
| 114 | + placeholder="Enter your password" |
| 115 | + > |
| 116 | + <button type="button" class="password-toggle-btn absolute inset-y-0 right-0 flex items-center px-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200" data-field-id="password"> |
| 117 | + <i class="fas fa-eye" id="password-eye"></i> |
| 118 | + </button> |
77 | 119 | </div> |
78 | | - <input |
79 | | - id="password" |
80 | | - type="password" |
81 | | - name="password" |
82 | | - required |
83 | | - class="block w-full pl-10 pr-10 py-3 border border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition @error('password') border-red-500 @enderror" |
84 | | - placeholder="Enter your password" |
85 | | - > |
86 | | - <button type="button" class="password-toggle-btn absolute inset-y-0 right-0 flex items-center px-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200" data-field-id="password"> |
87 | | - <i class="fas fa-eye" id="password-eye"></i> |
88 | | - </button> |
| 120 | + @error('password') |
| 121 | + <p class="mt-2 text-sm text-red-600">{{ $message }}</p> |
| 122 | + @enderror |
89 | 123 | </div> |
90 | | - @error('password') |
91 | | - <p class="mt-2 text-sm text-red-600">{{ $message }}</p> |
92 | | - @enderror |
93 | | - </div> |
94 | 124 |
|
95 | | - <!-- Remember Me --> |
96 | | - <div class="flex items-center justify-between"> |
97 | | - <div class="flex items-center"> |
98 | | - <input |
99 | | - id="rememberme" |
100 | | - name="rememberme" |
101 | | - type="checkbox" |
102 | | - {{ old('rememberme') ? 'checked' : '' }} |
103 | | - class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded" |
104 | | - > |
105 | | - <label for="rememberme" class="ml-2 block text-sm text-gray-700 dark:text-gray-300"> |
106 | | - Remember me |
107 | | - </label> |
| 125 | + <!-- Remember Me --> |
| 126 | + <div class="flex items-center justify-between"> |
| 127 | + <div class="flex items-center"> |
| 128 | + <input |
| 129 | + id="rememberme" |
| 130 | + name="rememberme" |
| 131 | + type="checkbox" |
| 132 | + {{ old('rememberme') ? 'checked' : '' }} |
| 133 | + class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded" |
| 134 | + > |
| 135 | + <label for="rememberme" class="ml-2 block text-sm text-gray-700 dark:text-gray-300"> |
| 136 | + Remember me |
| 137 | + </label> |
| 138 | + </div> |
| 139 | + |
| 140 | + @if(Route::has('forgottenpassword')) |
| 141 | + <a href="{{ route('forgottenpassword') }}" class="text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 transition"> |
| 142 | + Forgot password? |
| 143 | + </a> |
| 144 | + @endif |
108 | 145 | </div> |
109 | 146 |
|
110 | | - @if(Route::has('forgottenpassword')) |
111 | | - <a href="{{ route('forgottenpassword') }}" class="text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 transition"> |
112 | | - Forgot password? |
113 | | - </a> |
| 147 | + <!-- CAPTCHA (reCAPTCHA or Turnstile) --> |
| 148 | + @if(\App\Support\CaptchaHelper::isEnabled()) |
| 149 | + <div> |
| 150 | + {!! \App\Support\CaptchaHelper::display() !!} |
| 151 | + </div> |
| 152 | + @error(\App\Support\CaptchaHelper::getResponseFieldName()) |
| 153 | + <p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p> |
| 154 | + @enderror |
114 | 155 | @endif |
115 | | - </div> |
116 | 156 |
|
117 | | - <!-- CAPTCHA (reCAPTCHA or Turnstile) --> |
118 | | - @if(\App\Support\CaptchaHelper::isEnabled()) |
| 157 | + <!-- Submit Button --> |
119 | 158 | <div> |
120 | | - {!! \App\Support\CaptchaHelper::display() !!} |
| 159 | + <button |
| 160 | + type="submit" |
| 161 | + class="w-full flex justify-center items-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-blue-600 dark:bg-blue-700 hover:bg-blue-700 dark:hover:bg-blue-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition duration-150 ease-in-out" |
| 162 | + > |
| 163 | + <i class="fas fa-sign-in-alt mr-2"></i> |
| 164 | + Sign In |
| 165 | + </button> |
121 | 166 | </div> |
122 | | - @error(\App\Support\CaptchaHelper::getResponseFieldName()) |
123 | | - <p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p> |
124 | | - @enderror |
125 | | - @endif |
126 | | - |
127 | | - <!-- Submit Button --> |
128 | | - <div> |
129 | | - <button |
130 | | - type="submit" |
131 | | - class="w-full flex justify-center items-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-blue-600 dark:bg-blue-700 hover:bg-blue-700 dark:hover:bg-blue-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition duration-150 ease-in-out" |
132 | | - > |
133 | | - <i class="fas fa-sign-in-alt mr-2"></i> |
134 | | - Sign In |
135 | | - </button> |
136 | | - </div> |
137 | | - </form> |
138 | | - |
139 | | - @include('partials.passkey-authenticate') |
| 167 | + </form> |
| 168 | + </div> |
140 | 169 | </div> |
141 | 170 |
|
142 | 171 | <!-- Card Footer --> |
|
0 commit comments