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');
// Direct to the home page
if (data.success)
window.location.href = (redirect !== undefined) ? redirect : '/';
else
alert(data.msg || 'Unknown error occurred');
},
error: function(e,status,error) {
throw new Error(status || 'Unknown error occurred');

View File

@ -72,6 +72,8 @@
</div>
</div>
<div class="row">
<div class="col-lg-6 col-12">
<div class="row">
<div class="col-12">
<a class="link-danger" href="{{ url('password/reset') }}">Forgot Password</a>
@ -84,6 +86,12 @@
</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>
</form>
@ -94,6 +102,11 @@
<script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script>
<script type="text/javascript">
$(document).ready(function() {
$('#passkey').on('click',function() {
passkey_check('{{ csrf_token() }}','{{ back()->getTargetUrl() }}');
return false;
});
});
</script>
@append