auth

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

104:bc77a315f823 Go to Latest

auth/authd/templates/simple.gotmpl

Add request helpers. Fix a typo in the requestErrConflict constant. Create a response type that is used to build responses before sending them down the wire. Create vars for a few common types of error responses that never change. Create a negotiate middleware function that will respond with a 406 error if the client requests an encoding that we can't support. Create an encode helper that determines the requested encoding and uses it to send the data down the wire. Move our wrap middleware from the oauth2.go file to the request.go file, where it's more likely to be looked for.

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 }}