mirror of
https://github.com/fosrl/badger.git
synced 2026-02-08 05:56:46 +00:00
write readme and add license
This commit is contained in:
12
main.go
12
main.go
@@ -32,10 +32,6 @@ type VerifyResponse struct {
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
func CreateConfig() *Config {
|
||||
return &Config{}
|
||||
}
|
||||
|
||||
type Badger struct {
|
||||
next http.Handler
|
||||
name string
|
||||
@@ -44,6 +40,10 @@ type Badger struct {
|
||||
resourceSessionCookieName string
|
||||
}
|
||||
|
||||
func CreateConfig() *Config {
|
||||
return &Config{}
|
||||
}
|
||||
|
||||
func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
|
||||
return &Badger{
|
||||
next: next,
|
||||
@@ -76,8 +76,6 @@ func (p *Badger) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("verify request", string(jsonData))
|
||||
|
||||
resp, err := http.Post(verifyURL, "application/json", bytes.NewBuffer(jsonData))
|
||||
if err != nil {
|
||||
http.Error(rw, "Internal Server Error", http.StatusInternalServerError)
|
||||
@@ -107,8 +105,6 @@ func (p *Badger) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("authorized")
|
||||
|
||||
p.next.ServeHTTP(rw, req)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user