Move passkey login to a button on the login page
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 35s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m41s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
Deon George 2024-04-25 20:20:43 +10:00
parent f42fe97902
commit 1a5c1eff7b
2 changed files with 25 additions and 9 deletions

View File

@ -212,7 +212,10 @@ async function passkey_check(csrf_token,redirect)
console.log('Passkey: Process Success'); console.log('Passkey: Process Success');
// Direct to the home page // Direct to the home page
window.location.href = (redirect !== undefined) ? redirect : '/'; if (data.success)
window.location.href = (redirect !== undefined) ? redirect : '/';
else
alert(data.msg || 'Unknown error occurred');
}, },
error: function(e,status,error) { error: function(e,status,error) {
throw new Error(status || 'Unknown error occurred'); throw new Error(status || 'Unknown error occurred');

View File

@ -73,14 +73,22 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-lg-6 col-12">
<a class="link-danger" href="{{ url('password/reset') }}">Forgot Password</a> <div class="row">
</div> <div class="col-12">
</div> <a class="link-danger" href="{{ url('password/reset') }}">Forgot Password</a>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<a class="link-danger" href="{{ url('register') }}">Register</a> <a class="link-danger" href="{{ url('register') }}">Register</a>
</div>
</div>
</div>
<div class="col-lg-6 col-12">
<button type="submit" id="passkey" name="submit" class="btn btn-primary float-end"><i class="bi bi-key"></i> Passkey</button>
</div> </div>
</div> </div>
</div> </div>
@ -94,6 +102,11 @@
<script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script> <script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script>
<script type="text/javascript"> <script type="text/javascript">
passkey_check('{{ csrf_token() }}','{{ back()->getTargetUrl() }}'); $(document).ready(function() {
$('#passkey').on('click',function() {
passkey_check('{{ csrf_token() }}','{{ back()->getTargetUrl() }}');
return false;
});
});
</script> </script>
@append @append