mirror of
https://github.com/volatiletech/authboss.git
synced 2024-11-28 08:58:38 +02:00
Delete now-unused code
- This may come back in a separated default Renderer of some kind.
This commit is contained in:
parent
cf05c8d36b
commit
7119b3a90e
@ -1,396 +0,0 @@
|
||||
// Code generated by go-bindata.
|
||||
// sources:
|
||||
// templates/confirm_email.html.tpl
|
||||
// templates/confirm_email.txt.tpl
|
||||
// templates/login.html.tpl
|
||||
// templates/recover.html.tpl
|
||||
// templates/recover_complete.html.tpl
|
||||
// templates/recover_email.html.tpl
|
||||
// templates/recover_email.txt.tpl
|
||||
// templates/register.html.tpl
|
||||
// DO NOT EDIT!
|
||||
|
||||
package response
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
_, err = io.Copy(&buf, gz)
|
||||
clErr := gz.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
}
|
||||
if clErr != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
type asset struct {
|
||||
bytes []byte
|
||||
info os.FileInfo
|
||||
}
|
||||
|
||||
type bindataFileInfo struct {
|
||||
name string
|
||||
size int64
|
||||
mode os.FileMode
|
||||
modTime time.Time
|
||||
}
|
||||
|
||||
func (fi bindataFileInfo) Name() string {
|
||||
return fi.name
|
||||
}
|
||||
func (fi bindataFileInfo) Size() int64 {
|
||||
return fi.size
|
||||
}
|
||||
func (fi bindataFileInfo) Mode() os.FileMode {
|
||||
return fi.mode
|
||||
}
|
||||
func (fi bindataFileInfo) ModTime() time.Time {
|
||||
return fi.modTime
|
||||
}
|
||||
func (fi bindataFileInfo) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _confirm_emailHtmlTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb2\xc9\x30\xb4\x73\xce\xcf\x4b\xcb\x2c\xca\x55\xa8\xcc\x2f\x2d\x52\x48\x4c\x4e\xce\x2f\xcd\x2b\xb1\xd1\x07\x4a\xf0\x72\xd9\x24\x15\x29\xe8\x83\xe8\x02\xbb\x80\x9c\xd4\xc4\xe2\x54\x85\xe4\x9c\xcc\xe4\x6c\x05\x9b\x44\x85\x8c\xa2\xd4\x34\x5b\xa5\xea\x6a\xbd\xda\x5a\x25\xa0\x9a\x8c\xd4\xa2\x54\x1b\xfd\x44\x3b\x85\x92\x7c\x85\x64\xac\x06\x16\x00\xcd\x01\x04\x00\x00\xff\xff\xe5\x3a\xff\x49\x6f\x00\x00\x00")
|
||||
|
||||
func confirm_emailHtmlTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_confirm_emailHtmlTpl,
|
||||
"confirm_email.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func confirm_emailHtmlTpl() (*asset, error) {
|
||||
bytes, err := confirm_emailHtmlTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "confirm_email.html.tpl", size: 111, mode: os.FileMode(438), modTime: time.Unix(1443044716, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confirm_emailTxtTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x24\xc8\xd1\x0d\x82\x40\x10\x04\xd0\x56\xa6\x02\x6b\xb1\x00\x7e\xce\x73\xd1\x8d\xeb\x0c\xd9\x5b\x42\x08\xa1\x77\x4d\xf8\x7c\xef\x1e\xd6\x86\xa1\x6b\xd9\xd1\xf8\xc4\xd2\x46\x19\xea\x6d\x98\x15\xa1\xcd\xf9\x42\x38\x3f\x70\x96\xb0\x6b\x4d\x3c\x52\xdb\xb0\xc4\xdf\x5d\x9c\x3d\xbf\xd7\xb7\xde\xb5\xb2\x26\x4e\x3c\x8e\xdb\x79\xfe\x02\x00\x00\xff\xff\x66\x27\xac\x6d\x5b\x00\x00\x00")
|
||||
|
||||
func confirm_emailTxtTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_confirm_emailTxtTpl,
|
||||
"confirm_email.txt.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func confirm_emailTxtTpl() (*asset, error) {
|
||||
bytes, err := confirm_emailTxtTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "confirm_email.txt.tpl", size: 91, mode: os.FileMode(438), modTime: time.Unix(1443044716, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _loginHtmlTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x7c\x92\xcb\x6e\xeb\x20\x10\x86\xf7\x91\xf2\x0e\x88\xfd\x89\x5f\xc0\xb6\x74\xa4\xb3\x39\x52\x2f\x51\x1b\x75\x5b\x61\x3c\x0e\x28\x06\xac\x61\x9c\x8b\x90\xdf\xbd\xa6\x76\x5a\xd3\x46\xf1\xca\x0c\x3f\x1f\x1f\x30\x21\x6c\x9a\x56\x78\xf5\xee\x7b\x29\xc1\xfb\x61\x58\xaf\xf2\xc6\xa1\x61\x42\x92\x76\xb6\xe0\x21\x18\xd7\x5b\xea\x04\x29\xa8\x19\x6f\xdd\x5e\x5b\x3e\x0c\x9c\x19\x20\xe5\xea\x82\x6f\x9f\x5f\x77\xbc\x5c\xaf\xd8\xf8\x85\xa0\x1b\xb6\x01\x44\x87\xc3\x30\xb2\xe7\xbf\xbc\x42\x96\x95\x21\x80\xad\xe3\x06\x31\x99\x6b\xdb\xf5\xc4\xe8\xd2\x41\xc1\x09\xce\xc4\x99\x1c\x45\x7c\xc1\xe3\xee\x7f\xa4\xb3\x84\xae\xe5\xcc\x0a\x03\x51\x62\xd3\xa1\x36\x02\x2f\xff\xff\xc5\xbd\xbb\x56\x48\x50\xae\xad\x01\xe3\x24\x69\x6a\x81\xa5\x91\xa3\x68\xfb\x1f\x2b\xdf\x62\x69\x9c\x2b\x27\x9f\x44\x64\x36\xe9\x46\x85\x93\xc3\xfa\xae\xcd\x77\x28\xf1\xd8\x5e\xcb\xb7\xf8\x13\x5e\xe9\xba\x06\xbb\x38\xd5\xd9\x63\xf3\x34\x0e\x52\xe3\x58\xdd\xb9\x03\xd8\x58\xce\x92\xbb\xf5\xca\x9d\x5e\xc0\x80\xa9\x20\x5e\xec\x12\x2e\x15\xc8\x43\xe5\xce\x57\x3c\x9a\x2f\x26\x61\x0f\xbc\x64\xd7\x85\xec\x11\xd2\xc7\xa8\x7a\x22\x67\x67\x8e\xef\x2b\xa3\x89\x97\x0f\xf1\xa9\xf3\x6c\x9a\x4b\xce\xb4\x54\x91\xee\xf8\x69\x22\x98\x42\x68\x7e\xf5\x0b\x4e\x81\xd8\x31\xe5\x1c\x66\x7f\xa5\x8c\x91\x3c\x13\x69\x4f\x2c\xb1\x7b\xed\xe9\x3e\x77\x4a\xcc\xe0\x69\x70\x93\x9c\x67\xf1\x0d\xcb\x8f\x00\x00\x00\xff\xff\x66\x78\xba\x32\xea\x02\x00\x00")
|
||||
|
||||
func loginHtmlTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_loginHtmlTpl,
|
||||
"login.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func loginHtmlTpl() (*asset, error) {
|
||||
bytes, err := loginHtmlTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "login.html.tpl", size: 746, mode: os.FileMode(438), modTime: time.Unix(1443044716, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recoverHtmlTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x53\xb1\x6e\xe3\x30\x0c\xdd\x0f\xb8\x7f\x20\x84\xdc\x1a\xef\x07\xd9\x4b\x6e\xb9\xa5\x0d\xda\xa0\x6b\xa1\xd8\x74\x2c\x54\xa2\x04\x99\x4e\x13\xa8\xfe\xf7\x4a\x71\x10\xc4\x2d\xd0\xa0\x43\x3d\xd8\xa4\xf8\xde\xa3\xf9\x40\xc9\xd6\x05\x0b\xaa\x66\xed\xa8\x14\x31\x5a\x37\x10\x7b\xc5\x1d\x36\x20\x02\xd6\x6e\x8f\x41\x8c\xa3\x00\x8b\xdc\xb9\xa6\x14\xeb\xfb\xc7\x8d\xa8\x7e\xff\x82\xf4\x48\x4d\x7e\x60\xe0\xa3\xc7\x52\x30\x1e\x58\x00\x29\x8b\x59\x67\xe9\x83\xb6\x2a\x1c\xff\xff\xcb\x64\x6f\x54\x8d\x9d\x33\x0d\x86\x5c\x64\xcd\x06\x61\x0e\xd9\x2b\x33\x7c\x60\x3e\xe5\xa3\x5c\x2b\x2a\xb9\x0d\xe9\x3d\x75\x8d\x71\xe1\x75\x03\x7f\xcb\x99\x42\x8c\xaf\x9a\x3b\x58\x62\x08\xfd\x25\x5b\xa4\xcc\xe8\x9e\x33\x58\x53\x83\x07\x58\x42\x26\x67\x40\x50\xb4\xc3\x0b\x62\x1c\x65\xef\x15\x55\xa9\x7f\x0a\x8b\x53\x3c\x35\x8d\x11\xe9\x44\xb8\xfe\xdc\x98\xbf\x76\xd4\xea\x60\x9f\xbf\xf4\x61\x35\x81\xe0\x96\x1f\x67\xb1\xf5\x6d\x5b\xea\x4f\xbe\xc0\x1b\xa4\x98\xb8\x85\xcb\x3f\xfd\xe9\xc5\x77\xdc\xaa\x7f\xc8\xae\x4e\x37\x0d\xd2\xd5\xc2\x1c\xfa\xd0\xde\xa5\x64\x3e\x7c\x3e\xdd\xb8\x17\xa4\x69\xe0\xb3\xd0\x76\x60\x76\x74\x56\xea\x87\xad\xd5\x2c\xaa\x87\x69\x5b\x65\x31\x55\x67\xe6\x48\x05\x5d\xc0\xb6\x14\x85\x71\x3b\x4d\xa2\x5a\x29\xaa\xd1\xc8\x42\x25\x80\x2c\xf2\x25\xa8\xde\x03\x00\x00\xff\xff\xde\x17\x5e\xf0\x0b\x03\x00\x00")
|
||||
|
||||
func recoverHtmlTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_recoverHtmlTpl,
|
||||
"recover.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recoverHtmlTpl() (*asset, error) {
|
||||
bytes, err := recoverHtmlTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "recover.html.tpl", size: 779, mode: os.FileMode(438), modTime: time.Unix(1443044716, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recover_completeHtmlTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x52\xb1\x4e\xc3\x30\x10\xdd\x91\xf8\x87\x93\xc5\xdc\xec\xc8\xc9\xd2\x1d\x10\x74\x47\x6e\x7c\x69\x2c\xec\xb3\x65\x5f\xda\xa2\x28\xff\x8e\xdd\x94\x96\xaa\x20\x31\x40\x96\xf8\x9d\xef\xde\xf3\xd3\x3b\xd9\xf9\xe8\x40\xb5\x6c\x3c\xd5\x62\x1c\x9d\x1f\x88\x83\xe2\x1e\x35\x88\x88\xad\xdf\x62\xac\x5a\xef\x82\x45\x46\x31\x4d\x02\x1c\x72\xef\x75\x2d\x9e\x1e\x5f\x56\xa2\xb9\xbd\x81\xfc\x49\x43\x61\x60\xe0\xf7\x80\xb5\xe8\x8d\xd6\x48\x02\x48\xb9\x8c\xd8\xbf\x15\xb0\x55\x76\xc0\x22\xb0\x38\x14\x0a\x51\xf5\xdd\x70\x50\x29\xed\x7c\xd4\x9f\xe3\x67\x1c\xac\x6a\xb1\xf7\x56\x63\xcc\xe2\xa7\xf2\x91\xb8\xd0\xc9\x75\x3c\x91\x8e\xe3\xce\x70\x0f\x0b\x8c\x31\x4d\xd3\x11\xdd\x65\x64\x4d\x62\xb8\xaf\xc1\x90\xc6\x3d\x2c\xe0\xac\x50\xda\xa2\xa2\x0d\x9e\xfa\xa6\x49\xa6\xa0\xa8\xc9\xaf\xce\xc7\xea\x70\x9e\x45\xc6\x11\x49\x97\x81\xaf\xbf\x5f\xd8\x69\x3d\x75\x26\xba\xd7\x1f\x6c\x2d\xe7\x6b\xf8\x43\x7b\x57\x8a\xff\x61\xf3\x32\xf2\xcc\xb3\x4f\xb1\x7b\xc8\xa0\xe4\x7c\x8e\xbe\x54\x57\x57\xf1\xaf\x07\x66\x4f\x47\xa6\x34\xac\x9d\x61\xd1\x3c\xcf\xab\x27\xab\xf9\xf6\xc2\xbc\x54\xd0\x47\xec\x6a\x51\x59\xbf\x31\x24\x9a\xa5\xa2\x16\xad\xac\x54\x6e\x90\x55\xd9\xe8\xe6\x23\x00\x00\xff\xff\xf6\xef\xd0\x46\xd8\x02\x00\x00")
|
||||
|
||||
func recover_completeHtmlTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_recover_completeHtmlTpl,
|
||||
"recover_complete.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recover_completeHtmlTpl() (*asset, error) {
|
||||
bytes, err := recover_completeHtmlTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "recover_complete.html.tpl", size: 728, mode: os.FileMode(438), modTime: time.Unix(1443044716, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recover_emailHtmlTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb2\xc9\x30\xb4\x0b\x4a\x4d\xce\x2f\x4b\x2d\x52\xa8\xcc\x2f\x2d\x52\x48\x4c\x4e\xce\x2f\xcd\x2b\xb1\xd1\x07\x4a\xf0\x72\xd9\x24\x15\x29\xe8\x83\xe8\x02\xbb\x80\x9c\xd4\xc4\xe2\x54\x85\xe4\x9c\xcc\xe4\x6c\x05\x9b\x44\x85\x8c\xa2\xd4\x34\x5b\xa5\xea\x6a\xbd\xda\x5a\x25\xa0\x9a\x8c\xd4\xa2\x54\x1b\xfd\x44\x3b\x85\x92\x7c\x85\x22\xac\x06\x16\x00\xcd\x01\x04\x00\x00\xff\xff\xbd\x98\x68\x04\x6f\x00\x00\x00")
|
||||
|
||||
func recover_emailHtmlTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_recover_emailHtmlTpl,
|
||||
"recover_email.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recover_emailHtmlTpl() (*asset, error) {
|
||||
bytes, err := recover_emailHtmlTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "recover_email.html.tpl", size: 111, mode: os.FileMode(438), modTime: time.Unix(1443044716, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recover_emailTxtTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x24\xc8\xd1\x0d\x82\x40\x10\x04\xd0\x56\xa6\x02\x6b\xb1\x00\x7e\xce\x73\xd1\x8d\xeb\x0c\xd9\x5b\x42\x08\xa1\x77\x4d\xf8\x7c\xef\x1e\xd6\x86\xa1\x6b\xd9\xd1\xf8\xc4\xd2\x46\x19\xea\x6d\x98\x15\xa1\xcd\xf9\x42\x38\x3f\x70\x96\xb0\x6b\x4d\x3c\x52\xdb\xb0\xc4\xdf\x5d\x9c\x3d\xbf\xd7\xb7\xde\xb5\xb2\x26\x4e\x3c\x8e\xdb\x79\xfe\x02\x00\x00\xff\xff\x66\x27\xac\x6d\x5b\x00\x00\x00")
|
||||
|
||||
func recover_emailTxtTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_recover_emailTxtTpl,
|
||||
"recover_email.txt.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recover_emailTxtTpl() (*asset, error) {
|
||||
bytes, err := recover_emailTxtTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "recover_email.txt.tpl", size: 91, mode: os.FileMode(438), modTime: time.Unix(1443044716, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _registerHtmlTpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\x53\xb1\x6e\x83\x30\x10\x9d\x1b\x29\xff\x70\xb2\x32\x87\x3d\x32\x2c\xed\xd2\xa5\x8a\xaa\xaa\x6b\xe5\xe0\x23\x58\x35\xb6\x65\x9b\x26\x11\xe2\xdf\x6b\x43\x02\x81\xa8\x6d\xba\x18\xdf\xf1\xde\xf9\xbd\xd3\x1d\x2d\xb4\xad\x80\xe5\x5e\x68\x95\x92\xa6\xa9\x74\xad\xbc\x61\xbe\x44\x0e\xc4\xe2\x5e\x38\x8f\x96\xb4\x2d\x81\x0a\x7d\xa9\x79\x4a\x8c\x76\x9e\x64\xcb\xc5\x03\x95\x6c\x87\x12\x42\x81\x48\x5c\x1b\x2b\x2a\x66\x4f\xcf\x4f\x01\x9c\x35\x8d\x17\x5e\x22\x5c\x67\x37\x34\xe9\x18\x1d\x57\x28\x53\x7b\x50\xac\xc2\x1b\x32\xf8\x93\x09\x59\x8f\x47\x4f\xe0\x8b\xc9\xba\x83\x1c\x84\x2f\xaf\xca\xbd\xc7\x7c\xdb\x06\x6a\x3c\x50\xf1\x48\x34\x92\xe5\x58\x6a\xc9\xb1\x93\x74\x2b\x81\x40\x92\xd1\x9d\x0d\x67\xd0\xd0\x34\x2b\x23\x38\x6c\xd2\x09\xe4\xf2\x12\x5a\xeb\x86\x68\x15\x22\x19\x5a\x11\xc1\x42\x71\x3c\xc2\x1a\x22\x39\x02\x2c\x53\x7b\x1c\x10\x6d\x4b\x9d\x61\x2a\xeb\x84\xd1\xa4\xbb\xf7\x2f\x9e\x55\x4e\x3f\xb3\x36\x1a\xe6\xdc\x41\x5b\x4e\xb2\xed\xf9\xf6\x63\xd3\x06\xe8\xb9\x5d\x63\x3c\xe9\xc2\x76\x48\x4f\x9c\x4f\x3d\xf6\x16\xd6\x97\x12\xf7\x7a\x98\x89\xcf\xb5\x2a\x84\xad\x3e\x46\x13\x8f\x7d\x06\xfe\x34\x73\x43\xfd\xdd\xd4\xbc\xee\x3d\xe6\xe6\x4f\xfc\xc7\x64\x2f\xb5\x97\xe4\xea\x5d\x25\xc6\xc1\x7c\xbd\xac\xc8\x28\x80\x32\x28\x2d\x16\x29\x49\x42\x07\x98\xca\x51\xd2\x84\x85\x1f\xf3\x4a\xa5\xe0\x1c\x15\x19\x97\xe0\xe8\x6c\xf1\x12\x82\x38\xa7\xc3\xdc\x77\xd9\x37\xfd\x89\xaa\x1f\xdf\xe5\x82\x26\x71\x67\xb3\xef\x00\x00\x00\xff\xff\x21\x82\x69\xb5\xba\x03\x00\x00")
|
||||
|
||||
func registerHtmlTplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_registerHtmlTpl,
|
||||
"register.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func registerHtmlTpl() (*asset, error) {
|
||||
bytes, err := registerHtmlTplBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "register.html.tpl", size: 954, mode: os.FileMode(438), modTime: time.Unix(1446067138, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
// Asset loads and returns the asset for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.bytes, nil
|
||||
}
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
|
||||
// MustAsset is like Asset but panics when Asset would return an error.
|
||||
// It simplifies safe initialization of global variables.
|
||||
func MustAsset(name string) []byte {
|
||||
a, err := Asset(name)
|
||||
if err != nil {
|
||||
panic("asset: Asset(" + name + "): " + err.Error())
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// AssetInfo loads and returns the asset info for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func AssetInfo(name string) (os.FileInfo, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.info, nil
|
||||
}
|
||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||
}
|
||||
|
||||
// AssetNames returns the names of the assets.
|
||||
func AssetNames() []string {
|
||||
names := make([]string, 0, len(_bindata))
|
||||
for name := range _bindata {
|
||||
names = append(names, name)
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||
var _bindata = map[string]func() (*asset, error){
|
||||
"confirm_email.html.tpl": confirm_emailHtmlTpl,
|
||||
"confirm_email.txt.tpl": confirm_emailTxtTpl,
|
||||
"login.html.tpl": loginHtmlTpl,
|
||||
"recover.html.tpl": recoverHtmlTpl,
|
||||
"recover_complete.html.tpl": recover_completeHtmlTpl,
|
||||
"recover_email.html.tpl": recover_emailHtmlTpl,
|
||||
"recover_email.txt.tpl": recover_emailTxtTpl,
|
||||
"register.html.tpl": registerHtmlTpl,
|
||||
}
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
// directory embedded in the file by go-bindata.
|
||||
// For example if you run go-bindata on data/... and data contains the
|
||||
// following hierarchy:
|
||||
// data/
|
||||
// foo.txt
|
||||
// img/
|
||||
// a.png
|
||||
// b.png
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||||
// AssetDir("") will return []string{"data"}.
|
||||
func AssetDir(name string) ([]string, error) {
|
||||
node := _bintree
|
||||
if len(name) != 0 {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(cannonicalName, "/")
|
||||
for _, p := range pathList {
|
||||
node = node.Children[p]
|
||||
if node == nil {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
if node.Func != nil {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
rv := make([]string, 0, len(node.Children))
|
||||
for childName := range node.Children {
|
||||
rv = append(rv, childName)
|
||||
}
|
||||
return rv, nil
|
||||
}
|
||||
|
||||
type bintree struct {
|
||||
Func func() (*asset, error)
|
||||
Children map[string]*bintree
|
||||
}
|
||||
|
||||
var _bintree = &bintree{nil, map[string]*bintree{
|
||||
"confirm_email.html.tpl": &bintree{confirm_emailHtmlTpl, map[string]*bintree{}},
|
||||
"confirm_email.txt.tpl": &bintree{confirm_emailTxtTpl, map[string]*bintree{}},
|
||||
"login.html.tpl": &bintree{loginHtmlTpl, map[string]*bintree{}},
|
||||
"recover.html.tpl": &bintree{recoverHtmlTpl, map[string]*bintree{}},
|
||||
"recover_complete.html.tpl": &bintree{recover_completeHtmlTpl, map[string]*bintree{}},
|
||||
"recover_email.html.tpl": &bintree{recover_emailHtmlTpl, map[string]*bintree{}},
|
||||
"recover_email.txt.tpl": &bintree{recover_emailTxtTpl, map[string]*bintree{}},
|
||||
"register.html.tpl": &bintree{registerHtmlTpl, map[string]*bintree{}},
|
||||
}}
|
||||
|
||||
// RestoreAsset restores an asset under the given directory
|
||||
func RestoreAsset(dir, name string) error {
|
||||
data, err := Asset(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := AssetInfo(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// RestoreAssets restores an asset under the given directory recursively
|
||||
func RestoreAssets(dir, name string) error {
|
||||
children, err := AssetDir(name)
|
||||
// File
|
||||
if err != nil {
|
||||
return RestoreAsset(dir, name)
|
||||
}
|
||||
// Dir
|
||||
for _, child := range children {
|
||||
err = RestoreAssets(dir, filepath.Join(name, child))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func _filePath(dir, name string) string {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
// Package response is responsible for loading and rendering authboss templates.
|
||||
package response
|
||||
|
||||
//go:generate go-bindata -pkg=response -prefix=templates templates
|
||||
|
||||
// TODO(aarondl): Extract this into the default "template" provider
|
||||
|
||||
/*
|
||||
// Templates is a map depicting the forms a template needs wrapped within the specified layout
|
||||
type Templates map[string]*template.Template
|
||||
|
||||
|
||||
// LoadTemplates parses all specified files located in fpath. Each template is wrapped
|
||||
// in a unique clone of layout. All templates are expecting {{authboss}} handlebars
|
||||
// for parsing. It will check the override directory specified in the config, replacing any
|
||||
// templates as necessary.
|
||||
func LoadTemplates(ab *authboss.Authboss, layout *template.Template, fpath string, files ...string) (Templates, error) {
|
||||
m := make(Templates)
|
||||
|
||||
funcMap := template.FuncMap{
|
||||
"title": strings.Title,
|
||||
"mountpathed": func(location string) string {
|
||||
if ab.MountPath == "/" {
|
||||
return location
|
||||
}
|
||||
return path.Join(ab.MountPath, location)
|
||||
},
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
b, err := ioutil.ReadFile(filepath.Join(fpath, file))
|
||||
if exists := !os.IsNotExist(err); err != nil && exists {
|
||||
return nil, err
|
||||
} else if !exists {
|
||||
b, err = Asset(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
clone, err := layout.Clone()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
_, err = clone.New("authboss").Funcs(funcMap).Parse(string(b))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
m[file] = clone
|
||||
}
|
||||
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// Render renders a view with xsrf and flash attributes.
|
||||
func (t Templates) Render(ctx *authboss.Context, w http.ResponseWriter, r *http.Request, name string, data authboss.HTMLData) error {
|
||||
tpl, ok := t[name]
|
||||
if !ok {
|
||||
return authboss.RenderErr{TemplateName: tpl.Name(), Data: data, Err: ErrTemplateNotFound}
|
||||
}
|
||||
|
||||
data.MergeKV(
|
||||
"xsrfName", template.HTML(ctx.XSRFName),
|
||||
"xsrfToken", template.HTML(ctx.XSRFMaker(w, r)),
|
||||
)
|
||||
|
||||
if ctx.LayoutDataMaker != nil {
|
||||
data.Merge(ctx.LayoutDataMaker(w, r))
|
||||
}
|
||||
|
||||
if flash, ok := ctx.SessionStorer.Get(authboss.FlashSuccessKey); ok {
|
||||
ctx.SessionStorer.Del(authboss.FlashSuccessKey)
|
||||
data.MergeKV(authboss.FlashSuccessKey, flash)
|
||||
}
|
||||
if flash, ok := ctx.SessionStorer.Get(authboss.FlashErrorKey); ok {
|
||||
ctx.SessionStorer.Del(authboss.FlashErrorKey)
|
||||
data.MergeKV(authboss.FlashErrorKey, flash)
|
||||
}
|
||||
|
||||
buffer := &bytes.Buffer{}
|
||||
err := tpl.ExecuteTemplate(buffer, tpl.Name(), data)
|
||||
if err != nil {
|
||||
return authboss.RenderErr{TemplateName: tpl.Name(), Data: data, Err: ErrTemplateNotFound}
|
||||
}
|
||||
|
||||
_, err = io.Copy(w, buffer)
|
||||
if err != nil {
|
||||
return authboss.RenderErr{TemplateName: tpl.Name(), Data: data, Err: ErrTemplateNotFound}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RenderEmail renders the html and plaintext views for an email and sends it
|
||||
func Email(mailer authboss.Mailer, email authboss.Email, htmlTpls Templates, nameHTML string, textTpls Templates, namePlain string, data interface{}) error {
|
||||
tplHTML, ok := htmlTpls[nameHTML]
|
||||
if !ok {
|
||||
return authboss.RenderErr{TemplateName: tplHTML.Name(), Data: data, Err: ErrTemplateNotFound}
|
||||
}
|
||||
|
||||
tplPlain, ok := textTpls[namePlain]
|
||||
if !ok {
|
||||
return authboss.RenderErr{TemplateName: tplPlain.Name(), Data: data, Err: ErrTemplateNotFound}
|
||||
}
|
||||
|
||||
htmlBuffer := &bytes.Buffer{}
|
||||
if err := tplHTML.ExecuteTemplate(htmlBuffer, tplHTML.Name(), data); err != nil {
|
||||
return authboss.RenderErr{TemplateName: tplHTML.Name(), Data: data, Err: err}
|
||||
}
|
||||
email.HTMLBody = htmlBuffer.String()
|
||||
|
||||
plainBuffer := &bytes.Buffer{}
|
||||
if err := tplPlain.ExecuteTemplate(plainBuffer, tplPlain.Name(), data); err != nil {
|
||||
return authboss.RenderErr{TemplateName: tplPlain.Name(), Data: data, Err: err}
|
||||
}
|
||||
email.TextBody = plainBuffer.String()
|
||||
|
||||
if err := mailer.Send(email); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Redirect sets any flash messages given and redirects the user.
|
||||
// If flashSuccess or flashError are set they will be set in the session.
|
||||
// If followRedir is set to true, it will attempt to grab the redirect path from the
|
||||
// query string.
|
||||
func Redirect(ctx *authboss.Context, w http.ResponseWriter, r *http.Request, path, flashSuccess, flashError string, followRedir bool) {
|
||||
if redir := r.FormValue(authboss.FormValueRedirect); redir != "" && followRedir {
|
||||
path = redir
|
||||
}
|
||||
|
||||
if len(flashSuccess) > 0 {
|
||||
ctx.SessionStorer.Put(authboss.FlashSuccessKey, flashSuccess)
|
||||
}
|
||||
if len(flashError) > 0 {
|
||||
ctx.SessionStorer.Put(authboss.FlashErrorKey, flashError)
|
||||
}
|
||||
http.Redirect(w, r, path, http.StatusFound)
|
||||
}
|
||||
*/
|
@ -1,179 +0,0 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/volatiletech/authboss"
|
||||
"github.com/volatiletech/authboss/internal/mocks"
|
||||
)
|
||||
|
||||
var testViewTemplate = template.Must(template.New("").Parse(`{{.external}} {{.fun}} {{.flash_success}} {{.flash_error}} {{.xsrfName}} {{.xsrfToken}}`))
|
||||
var testEmailHTMLTemplate = template.Must(template.New("").Parse(`<h2>{{.}}</h2>`))
|
||||
var testEmailPlainTemplate = template.Must(template.New("").Parse(`i am a {{.}}`))
|
||||
|
||||
func TestLoadTemplates(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
file, err := ioutil.TempFile(os.TempDir(), "authboss")
|
||||
if err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
}
|
||||
if _, err := file.Write([]byte("{{.Val}}")); err != nil {
|
||||
t.Error("Error writing to temp file", err)
|
||||
}
|
||||
|
||||
layout, err := template.New("").Parse(`<strong>{{template "authboss" .}}</strong>`)
|
||||
if err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
}
|
||||
|
||||
filename := filepath.Base(file.Name())
|
||||
|
||||
tpls, err := LoadTemplates(authboss.New(), layout, filepath.Dir(file.Name()), filename)
|
||||
if err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
}
|
||||
|
||||
if len(tpls) != 1 {
|
||||
t.Error("Expected 1 template:", len(tpls))
|
||||
}
|
||||
|
||||
if _, ok := tpls[filename]; !ok {
|
||||
t.Error("Expected tpl with name:", filename)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTemplates_Render(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cookies := mocks.NewMockClientStorer()
|
||||
ab := authboss.New()
|
||||
ab.LayoutDataMaker = func(_ http.ResponseWriter, _ *http.Request) authboss.HTMLData {
|
||||
return authboss.HTMLData{"fun": "is"}
|
||||
}
|
||||
ab.XSRFName = "do you think"
|
||||
ab.XSRFMaker = func(_ http.ResponseWriter, _ *http.Request) string {
|
||||
return "that's air you're breathing now?"
|
||||
}
|
||||
|
||||
// Set up flashes
|
||||
cookies.Put(authboss.FlashSuccessKey, "no")
|
||||
cookies.Put(authboss.FlashErrorKey, "spoon")
|
||||
|
||||
r, _ := http.NewRequest("GET", "http://localhost", nil)
|
||||
w := httptest.NewRecorder()
|
||||
ctx := ab.NewContext()
|
||||
ctx.SessionStorer = cookies
|
||||
|
||||
tpls := Templates{
|
||||
"hello": testViewTemplate,
|
||||
}
|
||||
|
||||
err := tpls.Render(ctx, w, r, "hello", authboss.HTMLData{"external": "there"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if w.Body.String() != "there is no spoon do you think that's air you're breathing now?" {
|
||||
t.Error("Body was wrong:", w.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Email(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ab := authboss.New()
|
||||
mockMailer := &mocks.MockMailer{}
|
||||
ab.Mailer = mockMailer
|
||||
|
||||
htmlTpls := Templates{"html": testEmailHTMLTemplate}
|
||||
textTpls := Templates{"plain": testEmailPlainTemplate}
|
||||
|
||||
email := authboss.Email{
|
||||
To: []string{"a@b.c"},
|
||||
}
|
||||
|
||||
err := Email(ab.Mailer, email, htmlTpls, "html", textTpls, "plain", "spoon")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if len(mockMailer.Last.To) != 1 {
|
||||
t.Error("Expected 1 to addr")
|
||||
}
|
||||
if mockMailer.Last.To[0] != "a@b.c" {
|
||||
t.Error("Unexpected to addr @ 0:", mockMailer.Last.To[0])
|
||||
}
|
||||
|
||||
if mockMailer.Last.HTMLBody != "<h2>spoon</h2>" {
|
||||
t.Error("Unexpected HTMLBody:", mockMailer.Last.HTMLBody)
|
||||
}
|
||||
|
||||
if mockMailer.Last.TextBody != "i am a spoon" {
|
||||
t.Error("Unexpected TextBody:", mockMailer.Last.TextBody)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRedirect(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ab := authboss.New()
|
||||
cookies := mocks.NewMockClientStorer()
|
||||
|
||||
r, _ := http.NewRequest("GET", "http://localhost", nil)
|
||||
w := httptest.NewRecorder()
|
||||
ctx := ab.NewContext()
|
||||
ctx.SessionStorer = cookies
|
||||
|
||||
Redirect(ctx, w, r, "/", "success", "failure", false)
|
||||
|
||||
if w.Code != http.StatusFound {
|
||||
t.Error("Expected a redirect.")
|
||||
}
|
||||
|
||||
if w.Header().Get("Location") != "/" {
|
||||
t.Error("Expected to be redirected to root.")
|
||||
}
|
||||
|
||||
if val, _ := cookies.Get(authboss.FlashSuccessKey); val != "success" {
|
||||
t.Error("Flash success msg wrong:", val)
|
||||
}
|
||||
if val, _ := cookies.Get(authboss.FlashErrorKey); val != "failure" {
|
||||
t.Error("Flash failure msg wrong:", val)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRedirect_Override(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ab := authboss.New()
|
||||
cookies := mocks.NewMockClientStorer()
|
||||
|
||||
r, _ := http.NewRequest("GET", "http://localhost?redir=foo/bar", nil)
|
||||
w := httptest.NewRecorder()
|
||||
ctx := ab.NewContext()
|
||||
ctx.SessionStorer = cookies
|
||||
|
||||
Redirect(ctx, w, r, "/shouldNotGo", "success", "failure", true)
|
||||
|
||||
if w.Code != http.StatusFound {
|
||||
t.Error("Expected a redirect.")
|
||||
}
|
||||
|
||||
if w.Header().Get("Location") != "/foo/bar" {
|
||||
t.Error("Expected to be redirected to root.")
|
||||
}
|
||||
|
||||
if val, _ := cookies.Get(authboss.FlashSuccessKey); val != "success" {
|
||||
t.Error("Flash success msg wrong:", val)
|
||||
}
|
||||
if val, _ := cookies.Get(authboss.FlashErrorKey); val != "failure" {
|
||||
t.Error("Flash failure msg wrong:", val)
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
<h1>Confirm your account</h1>
|
||||
<br />
|
||||
<p>Please click <a href="{{.}}" />here</a> to confirm your account</p>
|
@ -1 +0,0 @@
|
||||
Please copy and paste the following link into your browser to confirm your account\n\n{{.}}
|
@ -1,11 +0,0 @@
|
||||
{{.flash_success}}
|
||||
<form action="{{mountpathed "login"}}" method="POST">
|
||||
{{if .error}}{{.error}}<br />{{end}}
|
||||
<input type="text" class="form-control" name="{{.primaryID}}" placeholder="{{title .primaryID}}" value="{{.primaryIDValue}}"><br />
|
||||
<input type="password" class="form-control" name="password" placeholder="Password"><br />
|
||||
<input type="hidden" name="{{.xsrfName}}" value="{{.xsrfToken}}" />
|
||||
{{if .showRemember}}<input type="checkbox" name="rm" value="true"> Remember Me{{end}}
|
||||
<button type="submit">Login</button><br />
|
||||
{{if .showRecover}}<a href="{{mountpathed "recover"}}">Recover Account</a>{{end}}
|
||||
{{if .showRegister}}<a href="{{mountpathed "register"}}">Register Account</a>{{end}}
|
||||
</form>
|
@ -1,9 +0,0 @@
|
||||
<form action="{{mountpathed "recover"}}" method="POST">
|
||||
<input type="text" name="{{.primaryID}}" placeholder="{{title .primaryID}}" value="{{.primaryIDValue}}" /><br />
|
||||
{{$pid := .primaryID}}{{with .errs}}{{with $errlist := index . $pid}}{{range $errlist}}<span>{{.}}</span><br />{{end}}{{end}}{{end}}
|
||||
<input type="text" name="confirm_{{.primaryID}}" placeholder="Confirm {{title .primaryID}}" value="{{.confirmPrimaryIDValue}}" /><br />
|
||||
{{$cpid := .primaryID | printf "confirm_%s"}}{{with .errs}}{{with $errlist := index . $cpid}}{{range $errlist}}<span>{{.}}</span><br />{{end}}{{end}}{{end}}
|
||||
<input type="hidden" name="{{.xsrfName}}" value="{{.xsrfToken}}" />
|
||||
<button type="submit">Recover</button><br />
|
||||
<a href="/login">Cancel</a>
|
||||
</form>
|
@ -1,10 +0,0 @@
|
||||
<form action="{{mountpathed "recover/complete"}}" method="POST">
|
||||
<input type="hidden" name="token" value="{{.token}}" />
|
||||
<input type="password" name="password" placeholder="Password" value="" /><br />
|
||||
{{with .errs}}{{with $errlist := index . "password"}}{{range $errlist}}<span>{{.}}</span><br />{{end}}{{end}}{{end}}
|
||||
<input type="password" name="confirm_password" placeholder="Confirm Password" value="" /><br />
|
||||
{{with .errs}}{{with $errlist := index . "confirm_password"}}{{range $errlist}}<span>{{.}}</span><br />{{end}}{{end}}{{end}}
|
||||
<input type="hidden" name="{{.xsrfName}}" value="{{.xsrfToken}}" />
|
||||
<button type="submit">Recover</button><br />
|
||||
<a href="/login">Cancel</a>
|
||||
</form>
|
@ -1,3 +0,0 @@
|
||||
<h1>Recover your account</h1>
|
||||
<br />
|
||||
<p>Please click <a href="{{.}}" />here</a> to recover your account</p>
|
@ -1 +0,0 @@
|
||||
Please copy and paste the following link into your browser to confirm your account\n\n{{.}}
|
@ -1,15 +0,0 @@
|
||||
<form action="{{mountpathed "register"}}" method="post">
|
||||
<label for="{{.primaryID}}">{{title .primaryID}}:</label>
|
||||
<input name="{{.primaryID}}" type="text" value="{{with .primaryIDValue}}{{.}}{{end}}" placeholder="{{title .primaryID}}" /><br />
|
||||
{{$pid := .primaryID}}{{with .errs}}{{with $errlist := index . $pid}}{{range $errlist}}<span>{{.}}</span><br />{{end}}{{end}}{{end}}
|
||||
<label for="password">Password:</label>
|
||||
<input name="password" type="password" placeholder="Password" /><br />
|
||||
{{with .errs}}{{range .password}}<span>{{.}}</span><br />{{end}}{{end}}
|
||||
<label for="confirm_password">Confirm Password:</label>
|
||||
<input name="confirm_password" type="password" placeholder="Confirm Password" /><br />
|
||||
{{with .errs}}{{range .confirm_password}}<span>{{.}}</span><br />{{end}}{{end}}
|
||||
<input type="submit" value="Register"><br />
|
||||
<a href="/">Cancel</a>
|
||||
|
||||
<input type="hidden" name="{{.xsrfName}}" value="{{.xsrfToken}}" />
|
||||
</form>
|
Loading…
Reference in New Issue
Block a user