style(web): a bit of code cleanup
This commit is contained in:
parent
083eac3fee
commit
e81ee683b7
@ -45,7 +45,7 @@ func TokenGenerate(seed []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Auth(handler http.HandlerFunc) http.HandlerFunc {
|
func Auth(handler http.HandlerFunc) http.HandlerFunc {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
authorized := false
|
authorized := false
|
||||||
defer func() {
|
defer func() {
|
||||||
if authorized {
|
if authorized {
|
||||||
@ -60,7 +60,7 @@ func Auth(handler http.HandlerFunc) http.HandlerFunc {
|
|||||||
authorized = true
|
authorized = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func HandlerAuth(w http.ResponseWriter, r *http.Request) {
|
func HandlerAuth(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user