28 lines
776 B
Markdown
28 lines
776 B
Markdown
# 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' }}');
|
|
});
|
|
});
|
|
</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');
|
|
</script>
|
|
```
|