auth request handler
This commit is contained in:
+6
-6
@@ -1,15 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"fmt"
|
||||
|
||||
"astraltech.xyz/calendar/v2/webserver"
|
||||
)
|
||||
|
||||
func LoginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
var test_html string = "Hello, world"
|
||||
w.Write([]byte(test_html))
|
||||
func HandleAuthRequest(username string, password string) bool {
|
||||
fmt.Printf("Handling Auth request for %s", username)
|
||||
return false
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -17,7 +16,8 @@ func main() {
|
||||
init_dav_client()
|
||||
|
||||
webserver.ServeLoginPage("/login", webserver.CustomizableLoginData{
|
||||
ServiceName: "Astral Calendar",
|
||||
ServiceName: "Astral Calendar",
|
||||
AuthRequestFunction: HandleAuthRequest,
|
||||
})
|
||||
webserver.EnableLogoRoute()
|
||||
webserver.EnableStaticRoute()
|
||||
|
||||
Reference in New Issue
Block a user