Move passkey login to a button on the login page
This commit is contained in:
parent
f42fe97902
commit
1a5c1eff7b
5
public/passkey/passkey.js
vendored
5
public/passkey/passkey.js
vendored
@ -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');
|
||||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user