diff options
| author | Christine Dodrill <me@christine.website> | 2019-01-26 07:32:58 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-01-26 07:32:58 -0800 |
| commit | b743ed30b5318dcd0ea0c526fce465cdd2fa73fc (patch) | |
| tree | dd023c1603ff107e7f47962052492d34798edfcc | |
| parent | f47b8a3b3f514b27c4fa3a46fffcc1b35a269ce0 (diff) | |
| download | x-b743ed30b5318dcd0ea0c526fce465cdd2fa73fc.tar.xz x-b743ed30b5318dcd0ea0c526fce465cdd2fa73fc.zip | |
idp: scare people away
| -rw-r--r-- | idp/main.go | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/idp/main.go b/idp/main.go index c0ba552..ed19620 100644 --- a/idp/main.go +++ b/idp/main.go @@ -39,6 +39,10 @@ func main() { log.Println(i.t.ProvisioningUri(*domain, *domain)) + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/html") + w.Write([]byte(rootPageTemplate)) + }) http.HandleFunc("/auth", i.auth) http.HandleFunc("/challenge", i.challenge) http.ListenAndServe(":"+*port, ex.HTTPLog(http.DefaultServeMux)) @@ -182,6 +186,31 @@ func (i *idp) challenge(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, u.String(), http.StatusTemporaryRedirect) } +const rootPageTemplate = `<html> +<head> +<link rel="stylesheet" href="https://unpkg.com/chota@0.5.2/dist/chota.min.css"> +<title>Auth</title> +<meta name=viewport content="width=400"> +<style> +:root { + --color-primary: #da1d50; /* brand color */ + --grid-maxWidth: 40rem; +} +</style> +</head> +<body id="top"> +<div class="container"> +<div class="card"> + <header> + <h4>Error</h4> + </header> + + <p>This is a private identity provider supporting <a href="https://indieauth.net">IndieAuth</a> for the use of <a href="https://christine.website">Christine Dodrill</a> only. Unauthorized access is forbidden.</p> +</div> +</div> +</body> +</html>` + const authPageTemplate = `<html> <head> <link rel="stylesheet" href="https://unpkg.com/chota@0.5.2/dist/chota.min.css"> @@ -202,7 +231,7 @@ const authPageTemplate = `<html> </header> <p><form action="/challenge" method="GET"> Code: <br> - <input type="text" name="code" value=""><br><br> + <input type="text" name="code" value="" autofocus><br><br> <input type="hidden" name="me" value="{{ .Me }}"> <input type="hidden" name="state" value="{{ .State }}"> <input type="hidden" name="client_id" value="{{ .ClientID }}"> |
