mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00

- refactored code - moved api/v1/auth to auth/ - security enhancement - env example update - default jwt ttl changed to 24 hours
22 lines
503 B
Go
22 lines
503 B
Go
package auth
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
|
|
_ "embed"
|
|
)
|
|
|
|
//go:embed block_page.html
|
|
var blockPageHTML string
|
|
|
|
var blockPageTemplate = template.Must(template.New("block_page").Parse(blockPageHTML))
|
|
|
|
func WriteBlockPage(w http.ResponseWriter, status int, error string, logoutURL string) {
|
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
|
blockPageTemplate.Execute(w, map[string]string{
|
|
"StatusText": http.StatusText(status),
|
|
"Error": error,
|
|
"LogoutURL": logoutURL,
|
|
})
|
|
}
|