auth

Paddy 2014-12-14 Parent:d03786cbf3ae Child:d442523df640

105:3a1fe5ee17f5 Go to Latest

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.

History
paddy@100 1 {{ define "login" }}<html>
paddy@100 2 <head>
paddy@100 3 <title>Log in</title>
paddy@100 4 </head>
paddy@100 5 <body>
paddy@100 6 <h1>Please log into your account</h1>{{ if .errors }}
paddy@100 7 <h2>Errors:</h2>
paddy@100 8 <ul>{{ range .errors }}
paddy@100 9 <li>{{ . }}</li>
paddy@100 10 </ul>{{ end }}{{ end }}
paddy@100 11 <form method="POST">
paddy@100 12 <p>Username: <input type="text" name="login"></p>
paddy@100 13 <p>Password: <input type="password" name="passphrase"></p>
paddy@100 14 <p><input type="submit"></p>
paddy@100 15 </form>
paddy@100 16 </body>
paddy@100 17 </html>{{ end }}