aboutsummaryrefslogtreecommitdiff
path: root/internal/ui/ui.go
diff options
context:
space:
mode:
authorGravatar Florian RĂ¼chel <florian.ruechel.github@inexplicity.de> 2023-11-06 04:27:35 +1030
committerGravatar GitHub <noreply@github.com> 2023-11-05 18:57:35 +0100
commit62ef8ed57aab9f2b05a64b153d231ae4f42769f4 (patch)
treeacc33ab1fd02113f8fc93751e593dc67ff504a84 /internal/ui/ui.go
parent62188b49f072ea3c2bf30a8ed42f8b9303840191 (diff)
downloadv2-62ef8ed57aab9f2b05a64b153d231ae4f42769f4.tar.gz
v2-62ef8ed57aab9f2b05a64b153d231ae4f42769f4.tar.zst
v2-62ef8ed57aab9f2b05a64b153d231ae4f42769f4.zip
Add WebAuthn / Passkey integration
This is a rebase of #1618 in which @dave-atx added WebAuthn support. Closes #1618
Diffstat (limited to 'internal/ui/ui.go')
-rw-r--r--internal/ui/ui.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/ui/ui.go b/internal/ui/ui.go
index 64149658..f95d6ebf 100644
--- a/internal/ui/ui.go
+++ b/internal/ui/ui.go
@@ -151,6 +151,16 @@ func Serve(router *mux.Router, store *storage.Storage, pool *worker.Pool) {
uiRouter.HandleFunc("/logout", handler.logout).Name("logout").Methods(http.MethodGet)
uiRouter.Handle("/", middleware.handleAuthProxy(http.HandlerFunc(handler.showLoginPage))).Name("login").Methods(http.MethodGet)
+ // WebAuthn flow
+ uiRouter.HandleFunc("/webauthn/register/begin", handler.beginRegistration).Name("webauthnRegisterBegin").Methods(http.MethodGet)
+ uiRouter.HandleFunc("/webauthn/register/finish", handler.finishRegistration).Name("webauthnRegisterFinish").Methods(http.MethodPost)
+ uiRouter.HandleFunc("/webauthn/login/begin", handler.beginLogin).Name("webauthnLoginBegin").Methods(http.MethodGet)
+ uiRouter.HandleFunc("/webauthn/login/finish", handler.finishLogin).Name("webauthnLoginFinish").Methods(http.MethodPost)
+ uiRouter.HandleFunc("/webauthn/deleteall", handler.deleteAllCredentials).Name("webauthnDeleteAll").Methods(http.MethodPost)
+ uiRouter.HandleFunc("/webauthn/{credentialHandle}/delete", handler.deleteCredential).Name("webauthnDelete").Methods(http.MethodPost)
+ uiRouter.HandleFunc("/webauthn/{credentialHandle}/rename", handler.renameCredential).Name("webauthnRename").Methods(http.MethodGet)
+ uiRouter.HandleFunc("/webauthn/{credentialHandle}/save", handler.saveCredential).Name("webauthnSave").Methods(http.MethodPost)
+
router.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.Write([]byte("User-agent: *\nDisallow: /"))