diff --git a/oauth2server/server/server.go b/oauth2server/server/server.go
index be85262..bf893a9 100755
--- a/oauth2server/server/server.go
+++ b/oauth2server/server/server.go
@@ -1,6 +1,7 @@
package server
import (
+ "fmt"
"local/oauth2/oauth2server/config"
"local/router"
"local/storage"
@@ -46,3 +47,33 @@ func purgeIssuedCredentials(store storage.DB) {
store.Set(token, nil, TOKEN)
}
}
+
+func wrapBody(title, body string) string {
+ return fmt.Sprintf(`
+
+
+
+ %s
+
+
+
+ %s
+
+
+ `, title, body)
+}
diff --git a/oauth2server/server/users.go b/oauth2server/server/users.go
index f9ca2fc..f68d67f 100755
--- a/oauth2server/server/users.go
+++ b/oauth2server/server/users.go
@@ -18,62 +18,26 @@ func (s *Server) usersLog(w http.ResponseWriter, r *http.Request) {
router.Params(r, &scope)
s.limiter.Wait(r.Context())
q := r.URL.Query()
- fmt.Fprintln(w, `
-
- BOA Log In `+scope+`
-
- `+scope+`
-
-
-
- `)
+ fmt.Fprintln(w, wrapBody("BOA Log In "+scope, `
+ `+scope+`
+
+ `))
}
func (s *Server) usersRegister(w http.ResponseWriter, r *http.Request) {
scope := ""
router.Params(r, &scope)
s.limiter.Wait(r.Context())
- fmt.Fprintln(w, `
-
- BOA Register `+scope+`
-
- `+scope+`
-
-
-
- `)
+ fmt.Fprintln(w, wrapBody("BOA Register "+scope, `
+ `+scope+`
+
+ `))
}
func (s *Server) usersSubmit(w http.ResponseWriter, r *http.Request) {