diff options
| author | Christine Dodrill <me@christine.website> | 2019-01-26 07:15:43 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-01-26 07:15:43 -0800 |
| commit | f47b8a3b3f514b27c4fa3a46fffcc1b35a269ce0 (patch) | |
| tree | 7a167a39a5a9403177e51664b7486e4ee016e17f /idp | |
| parent | 59b0848dae3651ab5c03ed8584189ca679e289ba (diff) | |
| download | x-f47b8a3b3f514b27c4fa3a46fffcc1b35a269ce0.tar.xz x-f47b8a3b3f514b27c4fa3a46fffcc1b35a269ce0.zip | |
idp: cleanup
Diffstat (limited to 'idp')
| -rw-r--r-- | idp/idpmiddleware/middleware.go | 8 | ||||
| -rw-r--r-- | idp/main.go | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/idp/idpmiddleware/middleware.go b/idp/idpmiddleware/middleware.go index b7e7388..ea7df24 100644 --- a/idp/idpmiddleware/middleware.go +++ b/idp/idpmiddleware/middleware.go @@ -8,6 +8,7 @@ import ( "fmt" "net/http" "net/url" + "strings" "sync" "time" @@ -64,6 +65,11 @@ func validate(resp *http.Response) (string, error) { return result.Me, nil } +// XeProtect sets defaults for Xe to use. +func XeProtect(selfURL string) func(next http.Handler) http.Handler { + return Protect("https://idp.christine.website", "https://christine.website/", selfURL) +} + // Protect protects a given URL behind your given idp(1) server. func Protect(idpServer, me, selfURL string) func(next http.Handler) http.Handler { lock := sync.Mutex{} @@ -125,7 +131,7 @@ func Protect(idpServer, me, selfURL string) func(next http.Handler) http.Handler return } - code := uuid.New() + code := strings.Replace(uuid.New(), "-", "", 0) lock.Lock() codes[code] = code lock.Unlock() diff --git a/idp/main.go b/idp/main.go index f19b690..c0ba552 100644 --- a/idp/main.go +++ b/idp/main.go @@ -186,6 +186,7 @@ const authPageTemplate = `<html> <head> <link rel="stylesheet" href="https://unpkg.com/chota@0.5.2/dist/chota.min.css"> <title>Auth</title> +<meta name=viewport content="width=400"> <style> :root { --color-primary: #da1d50; /* brand color */ |
