This commit is contained in:
Jannover5000r 2025-06-16 23:11:42 +02:00
parent 037cdbbcaf
commit d8d1fc3679
2 changed files with 13 additions and 11 deletions

View file

@ -44,13 +44,15 @@ func Auth() {
} }
log.Println("Run") log.Println("Run")
res, err := http.Post(Url, "application/json", login) LoginOut, err := http.Post(Url, "application/json", login)
if err != nil { if err != nil {
log.Printf("Error during authentication: %v", err) log.Printf("Error during authentication: %v", err)
return return
} }
log.Println(res) defer LoginOut.Body.Close()
log.Println("") out := LoginOut.Header.Values("Set-Cookie")
log.Println(out)
} }

16
main.go
View file

@ -9,8 +9,8 @@ import (
"net/http" "net/http"
"os" "os"
// "os/signal" "os/signal"
// "syscall" "syscall"
"time" "time"
Untis "untislogger/Bot" Untis "untislogger/Bot"
@ -45,14 +45,14 @@ func init() {
func main() { func main() {
go Untis.Auth() //starting API calls function go Untis.Auth() //starting API calls function
// Create a channel to receive OS signals // Create a channel to receive OS signals
/* sigChan := make(chan os.Signal, 1) sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
log.Println("Program is running. Press Ctrl+C to stop.") log.Println("Program is running. Press Ctrl+C to stop.")
// Block until we receive a signal // Block until we receive a signal
<-sigChan <-sigChan
log.Println("Shutting down...") */ log.Println("Shutting down...")
} }
func testPubIP() { func testPubIP() {