2024-04-25 05:05:51 +00:00
|
|
|
# Implementing passkey
|
|
|
|
|
|
|
|
## Add passkey to user update form
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
<!-- Passkeys -->
|
|
|
|
<script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#passkey').on('click',function(item) {
|
2024-07-22 12:33:31 +00:00
|
|
|
return passkey_create($(this),'{{ csrf_token() }}','fa-key','{{ ($o??$user)->passkey ? 'btn-success' : 'btn-outline-secondary' }}','btn-success','{{ ($o??$user)->passkey ? 'btn-secondary' : 'btn-outline-secondary' }}');
|
2024-04-25 05:05:51 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
```
|
|
|
|
|
|
|
|
## Enable passkey login
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
<!-- Passkeys -->
|
|
|
|
<script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2024-07-22 12:33:31 +00:00
|
|
|
passkey_check('{{ csrf_token() }}','/passkey/loggedin');
|
2024-04-25 05:05:51 +00:00
|
|
|
</script>
|
2024-07-22 12:33:31 +00:00
|
|
|
```
|