auth
auth/authd/templates/simple.gotmpl
Add JSON tags and profile handler registration. Add JSON tags to all our profile types. Make an invalid email format error return requestErrInvalidFormat, not requestErrInvalidValue. Add a RegisterProfileHandlers to associate the handlers regarding profiles with the specified router. Replace our TODOs to send data down the wire with calls to our encode helper.
1 {{ define "login" }}<html>
2 <head>
3 <title>Log in</title>
4 </head>
5 <body>
6 <h1>Please log into your account</h1>{{ if .errors }}
7 <h2>Errors:</h2>
8 <ul>{{ range .errors }}
9 <li>{{ . }}</li>
10 </ul>{{ end }}{{ end }}
11 <form method="POST">
12 <p>Username: <input type="text" name="login"></p>
13 <p>Password: <input type="password" name="passphrase"></p>
14 <p><input type="submit"></p>
15 </form>
16 </body>
17 </html>{{ end }}