7 "github.com/pusher/oauth2_proxy/pkg/logger"
10func loadTemplates(dir string) *template.Template {
14 logger.Printf("using custom template directory %q", dir)
15 t, err := template.New("").ParseFiles(path.Join(dir, "sign_in.html"), path.Join(dir, "error.html"))
17 logger.Fatalf("failed parsing template %s", err)
22func getTemplates() *template.Template {
23 t, err := template.New("foo").Parse(`{{define "sign_in.html"}}
25<html lang="en" charset="utf-8">
27 <title>Sign In</title>
28 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
31 font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
33 line-height: 1.42857143;
42 border:1px solid #ccc;
51 background-color: #428bca;
52 border: 1px solid #357ebd;
53 -webkit-border-radius: 4;
54 -moz-border-radius: 4;
58 text-decoration: none;
63 background-color: #3071a9;
64 border-color: #285e8e;
65 text-decoration: none;
68 display: inline-block;
79 line-height: 1.42857143;
81 background-color: #fff;
82 background-image: none;
83 border: 1px solid #ccc;
85 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
86 box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
87 -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
88 -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
89 transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
91 box-sizing: border-box;
101 display:inline-block;
105 text-decoration:underline;
113 <div class="signin center">
114 <form method="GET" action="{{.ProxyPrefix}}/start">
115 <input type="hidden" name="rd" value="{{.Redirect}}">
116 {{ if .SignInMessage }}
117 <p>{{.SignInMessage}}</p>
119 <button type="submit" class="btn">Sign in with {{.ProviderName}}</button><br/>
123 {{ if .CustomLogin }}
125 <form method="POST" action="{{.ProxyPrefix}}/sign_in">
126 <input type="hidden" name="rd" value="{{.Redirect}}">
127 <label for="username">Username:</label><input type="text" name="username" id="username" size="10"><br/>
128 <label for="password">Password:</label><input type="password" name="password" id="password" size="10"><br/>
129 <button type="submit" class="btn">Sign In</button>
134 if (window.location.hash) {
136 var inputs = document.getElementsByName('rd');
137 for (var i = 0; i < inputs.length; i++) {
138 inputs[i].value += window.location.hash;
144 {{ if eq .Footer "-" }}
145 {{ else if eq .Footer ""}}
146 Secured with <a href="https://github.com/pusher/oauth2_proxy#oauth2_proxy">OAuth2 Proxy</a> version {{.Version}}
155 logger.Fatalf("failed parsing template %s", err)
158 t, err = t.Parse(`{{define "error.html"}}
160<html lang="en" charset="utf-8">
162 <title>{{.Title}}</title>
163 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
169 <p><a href="{{.ProxyPrefix}}/sign_in">Sign In</a></p>
173 logger.Fatalf("failed parsing template %s", err)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list