Move passkey login to a button on the login page
This commit is contained in:
parent
f42fe97902
commit
1a5c1eff7b
3
public/passkey/passkey.js
vendored
3
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
|
||||||
|
if (data.success)
|
||||||
window.location.href = (redirect !== undefined) ? redirect : '/';
|
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');
|
||||||
|
@ -72,6 +72,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-6 col-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<a class="link-danger" href="{{ url('password/reset') }}">Forgot Password</a>
|
<a class="link-danger" href="{{ url('password/reset') }}">Forgot Password</a>
|
||||||
@ -84,6 +86,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -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">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#passkey').on('click',function() {
|
||||||
passkey_check('{{ csrf_token() }}','{{ back()->getTargetUrl() }}');
|
passkey_check('{{ csrf_token() }}','{{ back()->getTargetUrl() }}');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@append
|
@append
|
Loading…
Reference in New Issue
Block a user