passkey/README.md

28 lines
776 B
Markdown
Raw Permalink Normal View History

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) {
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">
passkey_check('{{ csrf_token() }}','/passkey/loggedin');
2024-04-25 05:05:51 +00:00
</script>
```