~tsileo/moi

05a67293ea6f633b1bc0be7e05c6ef9ec586ba37 — Thomas Sileo 9 months ago 6044bf7
Fix WebAuthn
1 files changed, 4 insertions(+), 2 deletions(-)

M templates/index.html
M templates/index.html => templates/index.html +4 -2
@@ 32,13 32,15 @@
	<input type="hidden" name="client_id" value="{{ .client_id }}">
	<input type="hidden" name="me" value="{{ .me }}">
	<input type="hidden" name="response_type" value="{{ .response_type }}">
    <input type="text" name="webauthn" id="webauthn" value="">
	{{ if .wa_payload }}
	<input type="text" name="webauthn" id="webauthn" value="" placeholder="click for security key"><br><br>
	{{ end }}
	<input type="submit" value="login" id="login">
</form>

  <script src="{{ url_for_js "/webauthn.js" }}"></script>
  <script>
var credentialRequestOptions = JSON.parse({{.js}});
var credentialRequestOptions = JSON.parse({{.wa_payload}});
if (credentialRequestOptions) {
  document.getElementById("webauthn").onclick = function(event) {
    Webauthn.login(credentialRequestOptions, payload => {