From c825a21b19ade9d8621e955581f7d99493d4a35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 13 Oct 2021 12:59:33 +0200 Subject: [PATCH] Error: Authenticator has already been registered --- bin/template.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/template.ml b/bin/template.ml index 54bd158..a21406d 100644 --- a/bin/template.ml +++ b/bin/template.ml @@ -102,7 +102,12 @@ let register_view origin user = }); }); }).catch(function (err) { - alert("exception: " + err); + // XXX: only if the exception came from navigator.credentials.create() + if (err.name === "InvalidStateError") { + alert("authenticator already registered"); + } else { + alert("exception: " + err); + } window.location = "/"; }); });