From e29dc1b5d8f9f9a4450c359c45f6a69597de8127 Mon Sep 17 00:00:00 2001 From: bel Date: Tue, 17 Mar 2020 03:53:21 +0000 Subject: [PATCH] CSS for server --- oauth2server/server/server.go | 31 +++++++++++++++++ oauth2server/server/users.go | 64 ++++++++--------------------------- 2 files changed, 45 insertions(+), 50 deletions(-) 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) {